29.12.2013 Views

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The REPORT Procedure 4 Program 977<br />

Calculate values for the computed variable. This compute block computes the value of<br />

Perish from the values for the Meat/Dairy department and the Produce department. Because<br />

the variables Sales and Department collectively define these columns, there is no way to<br />

identify the values to PROC REPORT by name. Therefore, the assignment statement uses<br />

column numbers to unambiguously specify the values to use. Each time PROC REPORT needs a<br />

value for Perish, it sums the values in the third and fourth columns of that row of the report.<br />

compute perish;<br />

perish=sum(_c3_, _c4_);<br />

endcomp;<br />

Produce a customized summary. This compute block creates a customized summary at the<br />

end of the report. The first LINE statement writes 57 hyphens (-) starting in column 4.<br />

Subsequent LINE statements write the quoted text in the specified columns and the values of<br />

the variables _C3_, _C4_, and _C5_ with the DOLLAR11.2 format. Note that the pointer control<br />

(@) is designed for the Listing destination. It has no effect on ODS destinations other than<br />

traditional <strong>SAS</strong> monospace output.<br />

compute after;<br />

line @4 57*’-’;<br />

line @4 ’| Combined sales for meat and dairy : ’<br />

@46 _c3_ dollar11.2 ’ |’;<br />

line @4 ’| Combined sales for produce : ’<br />

@46 _c4_ dollar11.2 ’ |’;<br />

line @4 ’|’ @60 ’|’;<br />

line @4 ’| Combined sales for all perishables: ’<br />

@46 _c5_ dollar11.2 ’ |’;<br />

line @4 57*’-’;<br />

endcomp;<br />

Select the observations to process. The WHERE statement selects for the report only the<br />

observations for departments p1 and p2 in stores in the northeast or northwest sector.<br />

where sector contains ’n’<br />

and (department=’p1’ or department=’p2’);<br />

Specify the title.<br />

title ’Sales Figures for Perishables in Northern Sectors’;<br />

run;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!