04-12-2012 04:28 PM
How to combine the log and .lst file into a single file and save it to a PDS on Mainframe.
Typically how it is handled now is,
After the successful run there are two files created.one is the log and the other is an lst file.
giving the command ST at the command input line both the files will be combined to a single file.
then using xdc command the above file is saved to the PDS and I manually give the name of the file to be saved as.
How can this be done in the program?
04-13-2012 08:47 AM
My mainframe days are a ways behind me, but if you really need to combine the two separate files, look for system utilities, like IEBGENER or IEBCOPY -- but it almost sounds to me like you are dealing directly with the "spool" files that capture output and that you are issuing viewing commands when viewing the output. If you captured both the LOG and the LST to mainframe datasets (sequential files), then you could use system utilities to combine them. Otherwise, I don't think you could use SAS to read them directly off the spool, I think you have to save them as files and then would have to read them and combine them with a program -- probably way more trouble than it's worth.
You might want to open a track with Tech Support, depending on what you're using as your interface to the mainframe for submitting jobs, (ROSCOE, WYLBUR, TSO, ISPF, JCL, etc), there may be other ways to do what you want without issuing line commands. But from the SAS end, I do not believe it is possible to route both the log and the listing to the same PDS member at the same time. I believe that SAS will "want" to create 2 separate files and you will have to join them together, somehow after your job runs.
04-16-2012 06:10 PM
You can use PROC PRINTTO to redirect both the log and the listing to one file.
proc printto log="&path\&target.txt"
Output and log content will be interleaved.
04-17-2012 09:53 AM
If you're using JCL, the DISP= parm will control whether you SHR or can write (OLD) or create new (NEW). In SAS on the mainframe, that equates to using the DISP option on the FILENAME statement if you are using a FILENAME statement.