options source pagesize=60 linesize=80 nodate;
data employee_data;
input IDNumber $ 1-4 LastName $ 9-19 FirstName $ 20-29
City $ 30-42 State $ 43-44 /
Gender $ 1 JobCode $ 9-11 Salary 20-29 @30 Birth date9.
@43 Hired date9. HomePhone $ 54-65;
format birth hired date9.;
datalines;
1919 Adams Gerald Stamford CT
M TA2 34376 15SEP48 07JUN75 203/781-1255
1653 Alexander Susan Bridgeport CT
F ME2 35108 18OCT52 12AUG78 203/675-7715
1400 Apple Troy New York NY
M ME1 29769 08NOV55 19OCT78 212/586-0808
1350 Arthur Barbara New York NY
F FA3 32886 03SEP53 01AUG78 718/383-1549
1401 Avery Jerry Paterson NJ
M TA3 38822 16DEC38 20NOV73 201/732-8787
1499 Barefoot Joseph Princeton NJ
M ME3 43025 29APR42 10JUN68 201/812-5665
1101 Baucom Walter New York NY
M SCP 18723 09JUN50 04OCT78 212/586-8060
1333 Blair Justin Stamford CT
M PT2 88606 02APR49 13FEB69 203/781-1777
1402 Blalock Ralph New York NY
M TA2 32615 20JAN51 05DEC78 718/384-2849
1479 Bostic Marie New York NY
F TA3 38785 25DEC56 08OCT77 718/384-8816
1403 Bowden Earl Bridgeport CT
M ME1 28072 31JAN57 24DEC79 203/675-3434
1739 Boyce Jonathan New York NY
M PT1 66517 28DEC52 30JAN79 212/587-1247
1658 Bradley Jeremy New York NY
M SCP 17943 11APR55 03MAR80 212/587-3622
1428 Brady Christine Stamford CT
F PT1 68767 07APR58 19NOV79 203/781-1212
1407 Grant Daniel Mt. Vernon NY
M PT1 68096 26MAR57 21MAR78 914/468-1616
1114 Green Janice New York NY
F TA2 32928 21SEP57 30JUN75 212/588-1092
;
proc print data=employee_data(obs=12);
id idnumber;
title 'Personnel Data';
run; ods html close; ods listing;
proc print data=employee_data(obs=12); id idnumber; title 'Personnel Data'; run; ods listing close; ods html;Note the two ODS statements that follow the PROC PRINT step. To be able to view your LISTING output, you must execute the ODS LISTING CLOSE statement. It is simply good practice to reset ODS to HTML output, which is the default setting.
Personnel Data 1
First Job
IDNumber LastName Name City State Gender Code
1919 Adams Gerald Stamford CT M TA2
1653 Alexander Susan Bridgeport CT F ME2
1400 Apple Troy New York NY M ME1
1350 Arthur Barbara New York NY F FA3
1401 Avery Jerry Paterson NJ M TA3
1499 Barefoot Joseph Princeton NJ M ME3
1101 Baucom Walter New York NY M SCP
1333 Blair Justin Stamford CT M PT2
1402 Blalock Ralph New York NY M TA2
1479 Bostic Marie New York NY F TA3
1403 Bowden Earl Bridgeport CT M ME1
1739 Boyce Jonathan New York NY M PT1
IDNumber Salary Birth Hired HomePhone
1919 34376 15SEP1948 07JUN1975 203/781-1255
1653 35108 18OCT1952 12AUG1978 203/675-7715
1400 29769 08NOV1955 19OCT1978 212/586-0808
1350 32886 03SEP1953 01AUG1978 718/383-1549
1401 38822 16DEC1938 20NOV1973 201/732-8787
1499 43025 29APR1942 10JUN1968 201/812-5665
1101 18723 09JUN1950 04OCT1978 212/586-8060
1333 88606 02APR1949 13FEB1969 203/781-1777
1402 32615 20JAN1951 05DEC1978 718/384-2849
1479 38785 25DEC1956 08OCT1977 718/384-8816
1403 28072 31JAN1957 24DEC1979 203/675-3434
1739 66517 28DEC1952 30JAN1979 212/587-1247
ods html file='HTML-file-pathname.html'; ods pdf file='PDF-file-pathname.pdf'; ods rtf file='RTF-file-pathname.rtf'; ods ps file='PS-file-pathname.ps';
proc print data=employee_data(obs=12); id idnumber; title 'Personnel Data'; run; ods _all_ close; ods listing;