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

Hello Friends

 

I have the following programe.  Can you please help me whether is there any issue with this code?

 

DATA test5;
INFORMAT LASTNAME $20. DOB MMDDYY8. GENDER $1.;
INPUT ID LASTNAME $12. DOB mmddyy8. HEIGHT 2. WEIGHT 3. GENDER $1. AGE 2.;
FORMAT DOB MMDDYY8.;
DATALINES;
1 SMITH 1/23/66 68 144 M 26
2 JONES 3/14/60 78 202 M 32
3 DOE 11/26/47 62 99 F 45
4 WASHINGTON 8/1/70 66 101 F 22
Run;

PROC PRINT;
TITLE 'Example 3.1';
RUN;

 

 

Thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
kiranv_
Rhodochrosite | Level 12

something like this should work. plesse look into this link which will help you understand . http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a003209907.htm

 

 

DATA test5;

informat lastname $12.;

INPUT ID LASTNAME $ DOB: mmddyy8. HEIGHT WEIGHT GENDER $ AGE ;

FORMAT DOB MMDDYY8.;

DATALINES;

1 SMITH 1/23/66 68 144 M 26

2 JONES 3/14/60 78 202 M 32

3 DOE 11/26/47 62 99 F 45

4 WASHINGTON 8/1/70 66 101 F 22

Run;

PROC PRINT;

TITLE 'Example 3.1';

RUN;

View solution in original post

2 REPLIES 2
kiranv_
Rhodochrosite | Level 12

something like this should work. plesse look into this link which will help you understand . http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a003209907.htm

 

 

DATA test5;

informat lastname $12.;

INPUT ID LASTNAME $ DOB: mmddyy8. HEIGHT WEIGHT GENDER $ AGE ;

FORMAT DOB MMDDYY8.;

DATALINES;

1 SMITH 1/23/66 68 144 M 26

2 JONES 3/14/60 78 202 M 32

3 DOE 11/26/47 62 99 F 45

4 WASHINGTON 8/1/70 66 101 F 22

Run;

PROC PRINT;

TITLE 'Example 3.1';

RUN;

sas_td2016
Obsidian | Level 7

Thanks a lot.  Highly appreciated.  This works.  

I will check out the link you provided for more info.

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
  • 2 replies
  • 1143 views
  • 0 likes
  • 2 in conversation