I have already posted this in "SAS Proc" forum then I thought this would be better place to post my question. Appreciate all your help....
I am having problem with my current coding.
I have a file with Department Id, Agent Id Month and Sales info. There will be 2 - 4 occurrence for a particular agent. I have to create a report for every agent with Agent Id and Department Id displayed on the top and Month and Sales Info as detailed lines. I am able to do one agent per page I am to put 3 agents per page but I couldn't. Any Help will be appreciated...
I'm not sure I understand what you're after. There can be 2-4 occurrences per agent. You want to put 3 occurrences per page, is that right? Do all the occurrences have to be for a single agent? What happens if there are only 2 occurrences for an agent? If there are 4 occurrences for an agent do you want the first page to show 3 occurrences and the 2nd page to show only the 4th occurrence, or do you want to it to also show 2 occurrences for the next agent?
Thanks for the response. I really appreciate this.
I am using SAS @ Z/OS. Its Batch Reporting in Mainframes and I have started using SAS recently and trying to learn as much as I can !!.
I have tried to explain the situation as much as can. Please let me know whether this makes sense to you
The requirement is to provide detailed report for each agent where the name, department will come on the top and sales detail per month will come as detailed line (Like the Bank statement where the address appears on the top and all your transactions appear in tabular format).
I have coded initially one agent in one page (using Compute before _page_ and Line statements to display Agent Id and then the detail lines but now I got an additional request to print 3 agents in one page so that we can save paper.
My data Looks like this (3 byte dept, 5 bytes Agent, 2 byte Month and Sales amount)
Tim may have some other ideas based on your comments. My thoughts on your question/report are that a lot of folks do "batch" reporting on the Mainframe, but they still use ODS to create files that are then FTP'd to another platform or to a web server for viewing. It sounds to me, however, like you are NOT planning to use ODS. And that you want to generate text-based, LISTING window, SYSOUT DD type of output from your mainframe job. It almost seems like you're duplicating a COBOL or EASYTRIEVE report...this looks very like some of those reports I used to generate "back in the day".
If you want to generate output for the LISTING window or your SYSOUT DD on the mainframe, the kind of report that you outline is one that typically is done with DATA _NULL_ to FILE PRINT, using PUT statements. In that instance, you can write to the SYSOUT DD, use statements like PUT _PAGE_ and count the number of lines left on the page using FILE statement options.
You can come close to the report you want with PROC REPORT, but PROC REPORT does not generally repeat column headers between groups unless you are using BY group processing, and, generally with BY group processing, every BY group starts a new page. You could assign an arbitrary variable in your data so that you would identify the groups of 3 that should be on one page -- but by the time you're doing that for PROC REPORT, you may as well be writing PUT statements.
The documentation for the FILE statement and the PUT statement have a lot of examples of writing files to the LISTING window with DATA _NULL_ programs.
Thanks for your time...
I was thinking about getting the "Report" created by PROC REPORT and remove the "ASA Print Character" that causes Page breaks whne the page number is other than 1 or when the remineder page / 3 gives me 1 but I was not sure whether its an elegant way to use SAS.
I hope to learn fast and wish to contribure to the forum soon...
Without worrying about carriage control characters, the first thing you can do is determine what kind of printer you have available on the mainframe. If you can only use a fixed pitch font on your printer, then the default font that SAS uses for output to the LISTING window or SYSOUT DD is SAS Monospace (I believe this is also true on the Mainframe -- but you'd have to check.)
At any rate, given the use of SAS Monospace font, the amount of "text" you can get per page will vary depending on your output orientation and the fontsize that you get. The amount of text you can write per page will also depend on these factors and SAS generally would like to have these LINESIZE and PAGESIZE settings for the following orientation and font sizes:
Orientation FontSize LineSize PageSize
Portrait 8pt 121 67
Portrait 10pt 97 54
Portrait 12pt 80 45
Landscape 8pt 158 50
Landscape 10pt 125 41
Landscape 12pt 105 34
I do remember that in the OLD old days, before fancy printers, the rule of thumb was that for a fixed pitch print train, you had 132 characters for Linesize and approx 50 lines per page for page size -- that was landscape orientation at 12 characters per inch on an 11" line and 6 lines per inch on an 8.5" page (you lose a bit off the top for printer alignment).
Yes, I use fixed font (Courier new) here for printing. My requirement is to write SAS to create reports to validate the fancy ones (using AFP) created for mailing to make sure that everything worded ok.
You are right about the linesize 132 (it can have max 133) and the first character is a Carriage control (there will be an 1 @ position 1 for New page), I will explore the FILE and PUT options and the quick fix for me is to play with "Carriage Control".