Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Convert display statements to file output

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
gehang

New User


Joined: 10 Dec 2010
Posts: 10
Location: Chicago

PostPosted: Tue Jan 10, 2012 10:01 pm    Post subject: Convert display statements to file output
Reply with quote

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
View user's profile Send private message

gehang

New User


Joined: 10 Dec 2010
Posts: 10
Location: Chicago

PostPosted: Tue Jan 10, 2012 10:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Jan 10, 2012 10:07 pm    Post subject:
Reply with quote

something like :

DISPLAY txt UPON SYSOUT

?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1530
Location: Andromeda Galaxy

PostPosted: Tue Jan 10, 2012 10:32 pm    Post subject:
Reply with quote

Yes if I understand your requirement map sysout to a dataset instead writing to spool
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7255

PostPosted: Wed Jan 11, 2012 4:37 am    Post subject: Reply to: Convert display lines to file output
Reply with quote

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
View user's profile Send private message
gehang

New User


Joined: 10 Dec 2010
Posts: 10
Location: Chicago

PostPosted: Wed Jan 11, 2012 5:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jan 11, 2012 7:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Thu Jan 12, 2012 5:42 pm    Post subject:
Reply with quote

@ 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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us