{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# a4 - EXAMPLE A4 SAS Program data group1 input age datalines...

This preview shows pages 1–5. Sign up to view the full content.

EXAMPLE A4 SAS Program data group1; input age @@; datalines; 1 3 7 9 12 17 21 26 30 32 36 42 45 51 ; run; data group2; set group1; if 0<=age<10 then agegroup=0; else if 10<=age<20 then agegroup=10; else if 20<=age<30 then agegroup=20; else if 30<=age<40 then agegroup=30; else if 40<=age<50 then agegroup=40; else if age >=50 then agegroup=50; run; proc print;run; data group3; set group1; agegroup=int(age/10)*10; run; proc print; run;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SAS Log 1 options ls=80 nodate pageno=1; 2 data group1; 3 input age @@; 4 datalines; NOTE: SAS went to a new line when INPUT statement reached past the end of a line. NOTE: The data set WORK.GROUP1 has 14 observations and 1 variables. NOTE: DATA statement used (Total process time): real time 0.12 seconds cpu time 0.00 seconds 6 ; 7 run; 8 9 data group2; 10 set group1; 11 if 0<=age<10 then agegroup=0; 12 else if 10<=age<20 then agegroup=10; 13 else if 20<=age<30 then agegroup=20; 14 else if 30<=age<40 then agegroup=30; 15 else if 40<=age<50 then agegroup=40; 16 else if age >=50 then agegroup=50; 17 run; NOTE: There were 14 observations read from the data set WORK.GROUP1. NOTE: The data set WORK.GROUP2 has 14 observations and 2 variables.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}