Using SET keyword in SAS,in DATA RYAN2, we are referring to the dataset created in the first step and printing the same data in step RYAN2; SET is the keyword in SAS.
DATA RYAN;
INFILE POLIN;
INPUT @01 CITY $CHAR02.
@06 DATE $CHAR08.
@14 STATE $CHAR02.
@16 AMT COMMA9.2;
PROC SORT DATA=RYAN NODUPS;
BY CITY;
PROC PRINT DATA=RYAN;
DATA RYAN2;
SET RYAN; /* this is referring to the dataset created above*/
TITLE "I AM SHOWING SAME DATA OF RYAN";
PROC PRINT DATA=RYAN2;
RUN;
//*
Output:
Obs CITY DATE STATE AMT
1 CA 20130320 WB 100000.55
2 CA 20130320 WB 200000.55
3 CA 20130120 TN 500000.55
4 CA 20130320 KA 600000.55
5 MI 20130120 KA 300000.55
6 MI 20130320 AP 400000.55
7 RR 20130120 AP 700000.55
8 ST 20130320 TN 800000.55
I AM SHOWING SAME DATA OF POLIN
Obs CITY DATE STATE AMT
1 CA 20130320 WB 100000.55
2 CA 20130320 WB 200000.55
3 CA 20130120 TN 500000.55
4 CA 20130320 KA 600000.55
5 MI 20130120 KA 300000.55
6 MI 20130320 AP 400000.55
7 RR 20130120 AP 700000.55
8 ST 20130320 TN 800000.55
Continuing from the program above, we can add more datasets or add more data and carry on with creating the reports.
Thank you so much.
ReplyDelete