Hi SAS Forum,
Scenario 1
I have imported a Access dataset (lets call Access_have_1) into SAS. Lets call the created SAS data set as have_1.
Then just stacked it with an existing sas dataset called have_2.
Then created want_1 sas dataset.
data want_1;
set have_1
have_2;
run;
Scenario 2
I have first exported the same Access_have_1 dataset above as a CSV file.
Then read the CSV file into SAS and created the SAS data set named have_3.
Then stacked like below.
data want_2;
set have_3
have_2; /*exisiting SAS dataset*/
run;
Question:
I got Want_1 and Want_2 files as identical two files.
However, when I ran proc freq for a variable called "Arrears_history" in both files one keeps giving strange
freq resutls.
Scenario 1 gives this table.
proc freq data =want_1;
tables arrears_band/list missing;
run;
Arrears_Band | Frequency |
1 | |
1 - 30 | 10 |
30 - 60 | 25 |
60 - 90 | 5 |
1 - 30 | 15 |
30 - 60 | 15 |
60 - 90 | 8 |
90 + | 2 |
Current | 400 |
NPNA | 9 |
Scenario 2 gives this table.
proc freq data =want_2;
tables arrears_band/list missing;
run;
Arrears_Band | Frequency |
1 | |
1 - 30 | 25 |
30 - 60 | 40 |
60 - 90 | 13 |
90 + | 2 |
Current | 400 |
NPNA | 9 |
I keep trying several times still the same resutls are recurring.
You will see blue color and red color in the table under scenario 1 adds to meroon color figures in scenario 2 table.
Actually scenario 2 freq table is the correct one but how come scenario 1 table is strange.
Your help is appreciated.
Mirisage
(p.s. I cannot provide the data set as they are several thousands)
It means your data isn't the exact same, even though it looks like it is, usually because of extra spaces.
Try running a compbl or trim function on the arrear_bands to remove any leading or trailing blanks and re-run the proc freq.
Run Proc Contents on have_1 and have_2. See if the properties for Arrears_band are different.
It means your data isn't the exact same, even though it looks like it is, usually because of extra spaces.
Try running a compbl or trim function on the arrear_bands to remove any leading or trailing blanks and re-run the proc freq.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.