Here you can have all the SAS datasets, Tables and references which have been used in my blog.
1. To create the first table for sql join :
DATA DSN;
Do i = 20 to 40;
Retain ID 0;
ID+1;
AGE=ceil(i*(rand("Uniform")));
Height=Age+20;
If mod(age,2) then SEX='M';
Else Sex='F';
Output;
Drop i;
End;
Run;
1. To create the first table for sql join :
DATA DSN;
Do i = 20 to 40;
Retain ID 0;
ID+1;
AGE=ceil(i*(rand("Uniform")));
Height=Age+20;
If mod(age,2) then SEX='M';
Else Sex='F';
Output;
Drop i;
End;
Run;
2. To create Lookup table or dataset:
Data Lookup;
Input Age FName $ LNAME $ ;
Cards;
20 ROUSE JEREMY
25 ADAMS GERALD
26 BLAIR JUSTIN
39 BLALOCK RALPH
31 BROWN JASON
52 CARTER DONALD
60 CARTER DOROTHY
27 CHAPMAN NEIL
85 DEAN SANDRA
19 DENNIS ROGER
10 DUNLAP DONNA
1 EDGERTON JOSHUA
12 GARCIA JACK
23 HOWARD GRETCHEN
14 HOWARD MICHAEL
35 HUNTER CLYDE
16 HUNTER HELEN
8 JOHNSON JACKSON
28 OVERMAN MICHELLE
11 PHELPS WILLIAM
20 RODRIGUE ZJULIA
;
Run;
3. To create Dates dataset for all Date related queries :
Data Uma.Dates;
Input Date anydtdte.;
Format Date date9.;
Cards;
1Jan2010
112010
01012010
010110
;
Run;
No comments:
Post a Comment