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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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