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.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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