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

I haven't used SAS since March of last year in my graduate studies, so I was re-familiarizing myself with it. I feel mucho embarrassed, but I cannot understand why this code is not bringing in the balance. It is from Ron Cody's Learning SAS by Example book.

 

data financial;
	infile '/folders/myfolders/SAS/Learning/bank.txt';
	input Subj $ 1-3 
		  DOB $ 4-13 
		  Gender $ 14 
		  Balance 5-21;
run;

Here is the text file, again from Ron's book.

00110/21/1955M   1145
00211/18/2001F  18722
00305/07/1944M 123.45
00407/25/1945F -12345

Here is my result:
Screen Shot 2019-01-15 at 9.01.08 AM.png

Edited: Is it the space in the text file? I shouldn't think so given that I've reserved the columns.

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Should it say 15 instead of 5?

 

Balance 15-21;

 

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Should it say 15 instead of 5?

 

Balance 15-21;

 

--
Paige Miller
abbyrjones72
Obsidian | Level 7

Oh dear... yes.

abbyrjones72
Obsidian | Level 7
I'm gonna go give my masters back now lol.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 585 views
  • 2 likes
  • 2 in conversation