View previous topic :: View next topic
|
Author |
Message |
gehang
New User
Joined: 10 Dec 2010 Posts: 10 Location: Chicago
|
|
|
|
I'm working on converting a large program that has lots of display statements. This program has large sections of them that they now want to send to an output file.
So I have blocks such as:
Code: |
display ' We hit some variable so braching the program'.
display ' Starting processing at the start of a new file'.
display ' because we hit an error at some record'.
display ' and a bunch of other random text explinations'.
display ' usually these are 5 - 15 line blocks'.
display ' and there is probable close to 30 of them'.
|
Instead of spending two days manually changing all of them to:
Code: |
move ' We hit some variable so braching the program'
to tmp.
write output-record from tmp.
move ' Starting processing at the start of a new file'
to tmp.
write output-record from tmp.
move ' because we hit an error at some record'
to tmp.
write output-record from tmp.
move ' and a bunch of other random text explinations'
to tmp.
write output-record from tmp.
move ' usually these are 5 - 15 line blocks'
to tmp.
write output-record from tmp.
move ' and there is probable close to 30 of them'
to tmp.
write output-record from tmp.
|
Is there some trick or tips for doing tedious tasks like this? |
|
Back to top |
|
|
gehang
New User
Joined: 10 Dec 2010 Posts: 10 Location: Chicago
|
|
|
|
FYI, I know I can use "c all 'display' 'move'" then 'cc' the write lines and paste them over and over after each display line.
I was just wondering if anyone had any other suggestions.
If there was a "paste after all matching lines" command that would be awesome. Then I could copy the 'to tmp. write output-record from tmp.' lines and run a 'insert copied lines after each display line' command. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
something like :
DISPLAY txt UPON SYSOUT
? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Yes if I understand your requirement map sysout to a dataset instead writing to spool |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you want to change the code to a move followed by a write, you could look at a little editor macro.
The shorter way has already been suggested, which is to change the //SYSOUT DD to have a dataset instead of SYSOUT=.
If you want to take the latter route, look at the OUTDD compiler option, where you can specify a different DDNAME for the default output from DISPLAY statements. This will remove the possibility of runtime diagnostic messages getting into your dataset of DISPLAY output.
If you want to take the former route, do some research (these forums, google, manuals) and see what you can make of things. Let us know in a new topic in the appropriate forum if you have any problems. |
|
Back to top |
|
|
gehang
New User
Joined: 10 Dec 2010 Posts: 10 Location: Chicago
|
|
|
|
Thank you everyone for the much appreciated advice. I'm going to look into using edit macos. I'll update if I get a chance later today. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Or use SDSF in batch as another step in the job executing the above program - and write the SYSOUT to a dataset. As an alternative IDCAMS or IEBGENER can also be used. Something like this should suffice, if SYSOUT and dataset both are needed:
Code: |
//STEP001 EXEC PGM=YOURPGM
//SYSOUT DD DSN=SYSOUT.ON.FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TEST,SPACE=(TRK,(2,1),RLSE),
// DCB=(LRECL=080,BLKSIZE=0,RECFM=FB)
//*
//STEP002 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSFILE DD DSN=YOUR.SYSOUT.ON.FILE,DISP=OLD
//SYSOUT DD SYSOUT=*,DCB=(LRECL=080,BLKSIZE=0,RECFM=FB)
//SYSIN DD *
REPRO INFILE(SYSFILE) OUTFILE(SYSOUT)
//* |
|
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@ gehang !
As i worked on an reengineering projekt, we had to redirect all WTO's in assembler and all DISPLAY's in cobol.
The easiest way was to write a MACRO for that. So we build a WTOLST (Write_To_List) and a DISPLLST (Display_To-List) Macro.
So a whole bunch of programms could be managed via a global-change at one strike. |
|
Back to top |
|
|
|