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

 

DATA df1;
Informat  dob DDMMYY10.  Date_ DATE9.;
Input @32dob DDMMYY10. @55Date_ DATE9.;
Format dob DDMMYY10. Date_ DATE9.;
DATALINES;
 05/06/1990  23Dec2000
 05/11/1991  20NOV2020
;
run;

 

I am new SAS programming. I would like to create data with dob and date column by using above code am Am getting output like below

dob  Date_

 .        .

 .        .

 

Please, help me where am gone wrong.

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

When you use @32 and @55 in an INPUT statement, it tells SAS to read starting in column 32 and starting in column 55, and there is nothing in there. 

 

This should work.

 

DATA df1;
Input dob :DDMMYY10. Date_ :DATE9.;
Format dob DDMMYY10. Date_ DATE9.;
DATALINES;
 05/06/1990  23Dec2000
 05/11/1991  20NOV2020
;
run;

 

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

When you use @32 and @55 in an INPUT statement, it tells SAS to read starting in column 32 and starting in column 55, and there is nothing in there. 

 

This should work.

 

DATA df1;
Input dob :DDMMYY10. Date_ :DATE9.;
Format dob DDMMYY10. Date_ DATE9.;
DATALINES;
 05/06/1990  23Dec2000
 05/11/1991  20NOV2020
;
run;

 

--
Paige Miller
SASCODERS
Fluorite | Level 6

is @32 ,@55 means we are telling SAS that column position?

ballardw
Super User

@SASCODERS wrote:

is @32 ,@55 means we are telling SAS that column position?


Yes. With input the @ moves the input pointer to that character position on the line of text to be read. Then your next "instruction" such as reading a variable occurs depending to the actual line

 

Similar, an #n reads "on line number n" if the Infile has been set up to read multiple lines correctly.

 

 

SASCODERS
Fluorite | Level 6

Thank you for explaining.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1493 views
  • 1 like
  • 3 in conversation