Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Data Temp;
- infile datalines delimiter=','; /*infile modifies the input statement, delimiter*/
- input gender id race ses schtyp prgtype $ read write math science socst ;
- datalines;
- 0,70,4,1,1,"general",57,52,41,47,57
- 1,121,4,2,1,"vocati",68,59,53,63,61
- 0,86,4,3,1,"general",44,33,54,58,31
- 0,141,4,3,1,"vocati",63,44,47,53,56
- 0,172,4,2,1,"academic",47,52,57,53,61
- 0,113,4,2,1,"academic",44,52,51,63,61
- 0,50,3,2,1,"general",50,59,42,53,61
- 0,11,1,2,1,"academic",34,46,45,39,36
- 0,84,4,2,1,"general",63,57,54,,51
- 0,48,3,2,1,"academic",57,55,52,50,51
- 0,75,4,2,1,"vocati",60,46,51,53,61
- 0,60,5,2,1,"academic",57,65,51,63,61
- 0,95,4,3,1,"academic",73,60,71,61,71
- ;
- run;
- proc print data=temp;
- run;
- Data Temp2;
- infile datalines delimiter=',' missover; /*infile modifies the input statement, delimiter specifies the barrier between
- data variables, missover strops reading in the lines when missing data is encountered*/
- input gender id race ses schtyp prgtype $ read write math science socst ;
- datalines;
- 0,70,4,1,1,"general",57,52,41,47,57
- 1,121,4,2,1,"vocati",68,59,53,63,61
- 0,86,4,3,1,"general",44,33,54,58,31
- 0,141,4,3,1,"vocati",63,44,47,53,56
- 0,172,4,2,1,"academic",47,52,57,53,61
- 0,113,4,2,1,"academic",44,52,51,63,61
- 0,50,3,2,1,"general",50,59,42,53,61
- 0,11,1,2,1,"academic",34,46,45,39,36
- 0,84,4,2,1,"general",63,57,54,,51
- 0,48,3,2,1,"academic",57,55,52,50,51
- 0,75,4,2,1,"vocati",60,46,51,53,61
- 0,60,5,2,1,"academic",57,65,51,63,61
- 0,95,4,3,1,"academic",73,60,71,61,71
- ;
- run;
- proc print data=Temp2;
- run;
- Data Temp3;
- infile datalines delimiter=',' dsd; /*DSD accounts for missing values when two consecutives
- delimiters are found, also assumes "" things are strings and does not shorten them*/
- input gender id race ses schtyp prgtype $ read write math science socst ;
- datalines;
- 0,70,4,1,1,"general",57,52,41,47,57
- 1,121,4,2,1,"vocati",68,59,53,63,61
- 0,86,4,3,1,"general",44,33,54,58,31
- 0,141,4,3,1,"vocati",63,44,47,53,56
- 0,172,4,2,1,"academic",47,52,57,53,61
- 0,113,4,2,1,"academic",44,52,51,63,61
- 0,50,3,2,1,"general",50,59,42,53,61
- 0,11,1,2,1,"academic",34,46,45,39,36
- 0,84,4,2,1,"general",63,57,54,,51
- 0,48,3,2,1,"academic",57,55,52,50,51
- 0,75,4,2,1,"vocati",60,46,51,53,61
- 0,60,5,2,1,"academic",57,65,51,63,61
- 0,95,4,3,1,"academic",73,60,71,61,71
- ;
- run;
- proc print data=Temp3;
- run;
- data pilotdata;
- infile datalines missover;
- input EmployeeID $
- FirstName $
- LastName $
- JobCode $
- Salary
- Category $;
- Datalines;
- E01046 DAVID CHAPMAN PILOT1 72660 DOM
- E02659 CLIFTON WILDER PILOT1 53630 DOM
- E04732 CHRISTIAN EDMINSTON PILOT1 76120 DOM
- E03389 LOUISE STAINES PILOT1 74390 DOM
- E01702 ROBERTA CHADWICK PILOT1 62280 DOM
- E01642 NANCY MCELROY PILOT2 78260 DOM
- E03875 PAUL GLENNON PILOT2 74620 DOM
- E03739 WILLIAM MCKENZIE PILOT2 74620 DOM
- E03637 HERMAN VELAZQUEZ PILOT2 79460 INT
- E04481 SANDRA SANFORD PILOT2 74820 DOM
- E03728 MELANIE MASON PILOT4 116510
- E03892 THEODORE LEE PILOT3 112690 INT
- E02417 JANICE CASEY PILOT3 124150 INT
- E02757 THOMAS KRELLWITZ PILOT3 122240 INT
- ;
- run;
- proc print data=pilotdata;
- var EmployeeID FirstName LastName JobCode Category;
- run;
- Data Pilot1; /*set is bringing in existing data ex. here is pilotdata*/
- Set pilotdata;
- /* Only uses data that have DOM, and the salary has limits*/
- If Category = 'DOM';
- If 65000 <= Salary <= 75000;
- Run;
- Proc Print data=Pilot1;
- Run;
- Proc Print data=pilotdata;
- where Category = 'DOM';
- where 65000 <= Salary <= 75000;
- Run;
Add Comment
Please, Sign In to add comment