0% found this document useful (0 votes)
14 views

Assignment 8

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Assignment 8

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

PROC Print and Sort

(1) Define print procedure?

(2) Define VAR, SPLIT, SUM, ID and BY statements?


(3) Define few proc print options like NOOBS, DOUBLE OBS, WIDTH and HEADING?
(4) How can we eliminate duplicate data values?
(5) Write a short program showing title and footnote in the output?
(6) How can we generate reports in different pages?
(7) How can we sort the data? Write the syntax?
(8) What is ASCII format? What type of variables is sorted by ASCII format? Show an
example?
(9) Dataset:

Region$ State$ Month$ Expenses Revenues


Southern GA JAN95 2000 8000
Southern GA FEB95 1200 6000
Southern FL FEB95 8500 11000
Northern NY FEB95 3000 4000
Northern NY MAR95 6000 5000
Southern FL MAR95 9800 13500
Northern MA MAR95 1500 1000

Generate a report as shown below using proc print and proc sort procedures

Revenue and Expenses figures for each region

-------------------------------------- Region=Northern State=MA --------------------------------------

Month Expenses Revenues

MAR95 1,500 1,000

-------------------------------------- Region=Northern State=NY --------------------------------------

Month Expenses Revenues

FEB95 3,000 4,000


MAR95 6,000 5,000
----------- -------- --------
Region 10,500 10,000
-------------------------------------- Region=Southern State=FL --------------------------------------

Month Expenses Revenues

FEB95 8,500 11,000


MAR95 9,800 13,500

-------------------------------------- Region=Southern State=GA --------------------------------------

Month Expenses Revenues

JAN95 2,000 8,000


FEB95 1,200 6,000
--------- -------- --------
Region 21,500 38,500
====== =====
32,000 48,500
(10)
Dataset:

Id $ First_Name$ Last_Name$ City:& $ State$ Gender $ Job_Code$ Salary


1919 Adams Gerald Stamford CT M TA2 34376
1653 Alexander Susan Bridgeport CT F ME2 35108
1400 Apple Troy New York NY M ME1 29769
1350 Arthur Barbara New York NY F FA3 32886
1401 Avery Jerry Paterson NJ M TA3 38822
1499 Barefoot Joseph Princeton NJ M ME3 43025
1101 Baucom Walter New York NY M SCP 18723
1333 Blair Justin Stamford CT M PT2 88606
1402 Blalock Ralph New York NY M TA2 32615
1479 Bostic Marie New York NY F TA3 38785
1403 Bowden Earl Bridgeport CT M ME1 28072
1739 Boyce Jonathan New York NY M PT1 66517

Generate a report as shown below using proc print and proc sort procedures

Expenses Incurred for


Salaries for Flight Attendants and Mechanics

Job code Gender Annual Salary


======= ===== ==========

FA3 F $32,886

ME1 M $29,769
M $28,072
--------- ------------
ME1 $57,841

ME2 F $35,108

ME3 M $43,025
PT1 M $66,517

PT2 M $88,606

SCP M $18,723

TA2 M $34,376
M $32,615
--------- ------------
TA2 $66,991

TA3 F $38,785
M $38,822
--------- ------------
TA3 $77,607
======
$487,304

You might also like