BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mirisage
Obsidian | Level 7

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_BandFrequency
1
1 - 3010
30 - 6025
60 - 905
1 - 3015
30 - 6015
60 - 908
90 +2
Current400
NPNA9

Scenario 2 gives this table.

proc freq data =want_2;

tables arrears_band/list missing;

run;

Arrears_BandFrequency
1
1 - 3025
30 - 6040
60 - 9013
90 +2
Current400
NPNA9

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)

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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.

View solution in original post

2 REPLIES 2
ballardw
Super User

Run Proc Contents on have_1 and have_2. See if the properties for Arrears_band are different.

Reeza
Super User

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 714 views
  • 3 likes
  • 3 in conversation