04-28-2022
kmin87
Fluorite | Level 6
Member since
03-30-2021
- 33 Posts
- 4 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by kmin87
Subject Views Posted 1021 04-28-2022 12:22 AM 1708 02-25-2022 10:49 AM 1639 02-16-2022 12:49 PM 715 12-17-2021 10:10 AM 1206 10-28-2021 02:23 PM 1265 10-28-2021 01:14 PM 1111 10-28-2021 01:08 PM 1285 10-28-2021 01:04 PM 1148 10-28-2021 09:59 AM 1249 10-27-2021 04:05 PM -
Activity Feed for kmin87
- Posted Linear Regression to predict sales data for each location for the next three months on Statistical Procedures. 04-28-2022 12:22 AM
- Posted Re: SAS Programming PROC Import CSV files issues on SAS Programming. 02-25-2022 10:49 AM
- Liked Re: Formatting proc print ods excel footnotes space between table for SASJedi. 02-21-2022 12:21 PM
- Posted Formatting proc print ods excel footnotes space between table on SAS Programming. 02-16-2022 12:49 PM
- Posted SAS importing two excel files to SAS. One column/variable is text and the other column is numeric on SAS Programming. 12-17-2021 10:10 AM
- Posted Re: Normalizing SAS data to make sure a particular variable or column as the latest entry per the da on SAS Programming. 10-28-2021 02:23 PM
- Posted Re: Normalizing SAS data to make sure a particular variable or column as the latest entry per the da on SAS Programming. 10-28-2021 01:14 PM
- Posted Re: Updating a database with a new file with the correct values based off another database on SAS Programming. 10-28-2021 01:08 PM
- Posted Normalizing SAS data to make sure a particular variable or column as the latest entry per the date on SAS Programming. 10-28-2021 01:04 PM
- Posted Re: Updating a database with a new file with the correct values based off another database on SAS Programming. 10-28-2021 09:59 AM
- Posted Updating a database with a new file with the correct values based off another database on SAS Programming. 10-27-2021 04:05 PM
- Liked Re: convert numeric social security with leading social security in character for ballardw. 10-20-2021 12:50 AM
- Posted Re: convert numeric social security with leading social security in character on SAS Programming. 10-19-2021 03:46 PM
- Posted convert numeric social security with leading social security in character on SAS Programming. 10-19-2021 03:14 PM
- Posted Re: Importing a text file in SAS of social security numbers and finding where it belongs in which li on SAS Programming. 09-16-2021 02:19 PM
- Posted Importing a text file in SAS of social security numbers and finding where it belongs in which lib on SAS Programming. 09-16-2021 01:08 PM
- Liked Re: ImportText file from a chatroom: Creating an output of how many letters the chatters posted per for Reeza. 08-17-2021 08:34 PM
- Posted ImportText file from a chatroom: Creating an output of how many letters the chatters posted per week on SAS Programming. 08-17-2021 05:23 PM
- Posted Proc import txt or excel files to make sure i have the leading zeros in the sas data tables on SAS Programming. 06-03-2021 03:47 PM
- Posted In SAS, how do i compare two excel files or two data set to make sure they are identical? on SAS Programming. 05-27-2021 04:03 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 1
04-28-2022
12:22 AM
Hello I am trying to predict the sales for each of the locations in the data base. The data has months and each location has sales numeric value for that respective month. I'm trying to create a linear predictive model and predict the next sales data for the next three months for each location. would anyone assist? DATA JOB;
INPUT Month HI CA NY WA TX;
DATALINES;
1 75 100 90 88 78
2 51 85 88 89 71
3 99 96 94 93 85
4 92 106 84 84 67
5 90 89 83 77 69
6 67 77 83 73 65
7 109 67 71 65 50
8 94 112 105 91 107
9 105 110 99 95 96
10 74 102 88 69 63
11 64 122 68 79 73
12 76 132 89 80 77
13 86 122 99 90 75
14 111 65 90 80 30
;
RUN;
... View more
02-16-2022
12:49 PM
ods excel file="\\desktop\sample.xlsx"
style=meadow options(embedded_titles="yes" sheet_interval="none" frozen_headers = '3' sheet_name="Data" EMBEDDED_FOOTNOTES='ON' ABSOLUTE_ROW_HEIGHT=",,,30,30,");
options nobyline;
proc print data=work.comparison noobs label;
var asc / style(column)={tagattr='format:@' just=c};
var diff1 diff2 diff3 / style={just=c};
var;
TITLE1 color=green BOLD "Title";
FOOTNOTE1 color=black height=1.5 "Prepared by John Smith on &sysdate9.";
FOOTNOTE2 color=black height=1.5 "Controlled by: Organization";
FOOTNOTE3 color=black height=1.5 "POC: john.smith@yah.com";
FOOTNOTE4 color=green BOLD "Title";
run;
ods excel close; There are additional code above to create the work.comparison data but the focus is in the code above to generate the data table in the excel file, sample.xlsx. Sometimes there may be more rows of data rather than one but for this caser there is one row, row 4 in excel file. For the footnotes, how do I create a space between the table from proc print and footnote. and how do I remove the border lines from the footnotes of rows 5-7. And how do I make the font smaller than the table font size or make the table font size bigger?
... View more
12-17-2021
10:10 AM
Hello, In SAS I am importing two separate excel files and storing them in the work library. The excel files have a "primary" column that has blank numbers and numbers that are in decimals or whole numbers. For example, there are 0.40 , 1, 0.333, or a blank. Eventually I will create a new data set based off these two sets. The primary column is text from one file after I import it and the primary column is a numeric in the other file when I import. I get an error that one variable is numeric and the other variable is character. How do I normalize the data? I want to make sure both the primary columns are either numeric or text before I do a new data with combining or set the two data sets. The column is primary and it is a text type when I import it in the sas
proc import out=prf1
datafile= "filepath/example.xlsx"
dbms=excelcs
sheet="sheetname";
run;
The column is primary and it is a numeric type when I import it in the sas
proc import out=prf2
datafile= "filepath/example2.xlsx"
dbms=excelcs
sheet="sheetname";
run;
So I tried this
data prf2;
orig = 'primary ';
new = put(orig, $8.);
drop primary ;
rename new=primary ;
run;
I opened the fsview data and the primary column has converted to numbers but it rounded all to single digits, for example .643 became 1
data prf1;
orig = 'primary ';
new = input(orig, 8.);
drop orig;
rename new=primary ;
run;
When I tried this way, the primary column is blank and it doesnt have the values from the original primary column. It was all periods.
... View more
10-28-2021
02:23 PM
thanks for the solution. That worked!!! I do have a follow up question if you dont mind. I am now merging this data set to another data set. So this new data set has entries with more columns. One of the column im checking for in this data set is with another column in the data set you just showed me. So lets say the want data set has a column titled correct_a and i have an original data set that the corresponding column a. I want to make sure the column a has the correct values according to correct_a. Some are equal and some may be different. WOuld this code work? data new; merge original(in=a) want(in=b); by id rank; if a=1; if a ne correct_a then a=correct_a; run;
... View more
10-28-2021
01:14 PM
Oh okay, here is the data set Name ID Code Rank Date
Smith, John 1 AB Junior 20170801
Smith, John 1 AC Junior 20170901
Smith, John 1 AD Senior 20180101
Smith, Peter 2 TT Manager 20170801
Smith, Peter 2 TP Manager 20171001
Ask, Teom 3 AB Junior 20170801
Powell, H 4 TT Manager 20170801
Powell, H 4 TP Senior 20190801
... View more
10-28-2021
01:08 PM
There are numerous data set. It has a month and a year from 2010JAN through 2021SEP. I have to go through a loop to each data bases to find the right value per my original data set to make sure I have the correct value in my original data set. But I need to make the criteria of the data in the original date to correspond to closest data bases above. For example in my original data set, there is an entry where in Dec2017 this person had a value of a "A" for a particular column. But I need to double check if that A is correct and go through the historical databases 2010JAN through 21SEP to see if its truly a but really 2017JAN to 2017DEC since that data was inputted in Dec 2017. If the value is A, then that is correct. However, if if in the 2017MAR, I find out it's different I need to replace the A with the correct value found in 2017MAR. Some of the databases might have a blank. For example 2017MAR may have a blank but in 2017FEB databases there is the correct value or that "A"
... View more
10-28-2021
01:04 PM
Hi, I have a new data set where I want to normalize. For example I want to get the most updated Code identifier for John Smith of that particular rank. So I want to just maintain data where Smith, John Code AC and rank junior or 2nd row in a new data set. I want to go through each entries, and make sure the right rank is with the right code per the most current date. How do i write a sas program to do this?
... View more
10-28-2021
09:59 AM
i used the attached excels as an example in my library. But basically I have the incorrect_master file with incorrect entries in column A, as highlighted in A. I need to loop through a hisotrical of databases named lib_yearmonth to find the right entry value. If there is a blank in the lib_202110 file, I need to go to the previous month to find it until I get the correct entry, I find the previous month with that correct entry. Once I find the correct entries, I want to create a new data set from the incorrect_masterfile with the correct entries associated with the column A. I did this so far.Assume that these excel files has already been imported or in the library. I need to make sure the entry date in the incorrect_master file associates with correct yearmonth of the historical data files or libraries too. For example if I input the entry in november 2021, I want to make sure I loop through the historical files in 2021 until I find the correct value. IF they values are correct then I dont need to update or replace my incorrect_master column a entries.
... View more
10-27-2021
04:05 PM
So for example, there is one data base in SAS library that someone created exampleA.incorrect and in this data I have rows of data with various columns. Let's say one column A for this entry has a value of "AT" in character. I find out that this is incorrect value. This data was inputted in 2017 and I have another Column titled "AsofDate" with the numeric value of Mar2017. So That's the month/year when it was inputted and it is incorrect. It has another column with the person's social security number I have another data base in SAS library that has a monthly history of the same data above (But this is the most correct one) and the same columns as above exampleA.correctJan2017 (that same row above but the Column A has a correct value of "AB") exampleA.correctFeb2017 exampleA.correctMar2017 exampleA.correctApr2017 exampleA.correctMay2017 ...it goes all the way to 2021 This library database is the snapshot of the data at the last day of that month. This historical databases are the most correct data. how do i create a new data set in SAS to find the correct value in the historical databases in the library and make a NEW data set with the correct value of "AB" I think I have to loop through all this historical data bases to find that individual ssn and if there is an mismatch of Column A from exampleA.incorrect and Column a in exampleA.correctJan2017 then making sure column A has the most correct value. Would you assist? I don't know where to begin.
... View more
10-19-2021
03:46 PM
I want the last four social security with leading zeros. For example one of the value in the column is 11 in numeric format and I want it to be 0011 in character format in a new column in a new data set
... View more
10-19-2021
03:14 PM
Hello, In SAS where I have a data table in the work . What line of code do I use to convert a character column to text column with leading zeros. For example, in the column SSN, it has numeric digits but some don't have leading 0s. Like for example, it is has 11 instead of 0011. How do I convert all the values in that column in a character type column with leading zeros to signify the last four of a social security number.
... View more
09-16-2021
02:19 PM
They have the same variables name and same properties.
... View more
09-16-2021
01:08 PM
I have multiple SAS data bases or libraries consisting of data. One is titled for example company.teamblue_weekly and company.teamred_weekly. It is social security numbers and relevant columns to that entry. I received a text file of society security. I am trying to find where the social security in which databases listed above so I tried to do this. filename in ("X:\folder\example.txt"); data test; input in; run; proc sort data=in; by ssn; run; data teamred teamblue; merge in (in=a) company.teamblue_weekly (in=b); by ssn; if a then output teamblue; run; this is what i was trying to do but i am not sure. Would anyone assist?
... View more
08-17-2021
05:23 PM
I want to import a text file and based on the chat logs from that chatroom, i want to create a weekly summary of how many letters the chatter typed for the week. How do i create a code to accomplish this? The text file is in this format --------------- Monday, August 2, 2021 --------------- [A] [7:00 PM] Aaaaaand its still down [B 🤙] [7:34 PM] Photo --------------- Tuesday, August 23, 2021 --------------- End state below (for example): A: 20 B: 0 From 1-7 Aug 2021
... View more