01-30-2013 12:51 PM
We have a process that requires us to capture the SAS PROC output in plain text format with the page break and line break translated to the appropriate ASA control characters.
The current process creates a regular output and we have a script (perl) that adds '1' for every new page and ' ' for every new line in the first column. This deletes any existing value in column one. There are hundreds of reports and they designed it to fill the whole length of the page. Is there a way we can force the PROC output to skip the first position with some option, instead of changing every reports.
01-30-2013 04:03 PM
Could you provide a small piece of code that would help communicate the situation a little better?
Helpful information would be:
1) Types of PROC(s) you're using.
2) Which ODS destination you're using
3) Sample output before & after the PERL script runs.
01-30-2013 06:20 PM
Your "ASA" control characters sound exactly like the carriage control characters we used to write to the mainframe. Generally, if you define or allocate the DCB of your SYSOUT to be FBA or VBA, I thought that the system reserved the first column for the carriage control characters automatically. I guess I don't know why you need a PERL script to insert carriage control characters unless you are trying to replicate on UNIX the kind of mainframe printer output that you can get on the mainframe automatically.
So you are probably not using ODS at all, but instead want to get the LISTING output. I believe you might want to look into the FORMDLIM option but in my mind, it's a question for Tech Support how to get the carriage control characters in a non-mainframe output file.
01-30-2013 07:20 PM
Just fix your PERL program. Or write one in SAS instead.
infile old ;
file new ;
if index(_infile_,'0C'x) then _infile_='1'||compress(_infile_,'0C'x);
else _infile_=' '||_infile_;
01-31-2013 01:24 AM
Thanks. We did modify the perl script to do exactly what you have provided (adding the control character to the line, instead of replacing the first character). We probably will go with this approach. The team is just evaluating if there is any impact at the end of the line.
01-31-2013 08:04 AM
If you take Tom's program and modify it slightly you can get all the .LST files in a directory rewritten with FORTRAN CC. With regards to end of the line. LRECL=512 should be long enough for any .LST but you can increase if you like.
The FILELINE1 variable indicates first line of a file which on my system has no '0C'x but I add CC '1' you may or may not want to do this I don't know.
filename FT59F001 './*.lst';
filename FT60F001 './CC';
length outfile file filename $256;
infile FT59F001 eof=eof eov=eov filename=filename lrecl=512;
if _n_ eq 1 or eov then do;
outfile = catx('/',pathname('FT60F001'),scan(file,-1,'/'));
putlog file= / outfile=;
when(fileline1) _infile_ = '1'||_infile_;
when(first(_infile_) eq '0C'x) substr(_infile_,1,1)='1';
otherwise _infile_ = ' '||_infile_;
file dummy filevar=outfile lrecl=512;