IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File-aid batch how to repeat a line...


IBM Mainframe Forums -> Compuware & Other Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ThecknoDecker

New User


Joined: 15 Dec 2020
Posts: 2
Location: Canada

PostPosted: Tue Dec 15, 2020 4:48 am
Reply with quote

Hi,
I got a few PDS that I need to edit their content to add an edited copy of a line.

When I find "Toronto" I want to make a copy to "DowntownArea"

so in a list like
So and so lives Montreal
Vancouver is a great town
The air in Toronto is humid
I want to go to Regina


Would end up
So and so lives Montreal
Vancouver is a great town
The air in Toronto is humid
The air in DowntownArea is humid

I want to go to Regina

--
What I got at the moment is an extraction of the line with "Toronto" that I modify to DowntownArea:
Code:
//STEP2 EXEC PGM=FILEAID                                     
//SYSPRINT DD SYSOUT=*                                       
//SYSLIST  DD DSN=RIT01U.POAACF2.PRIV.FIL.BEFORE,DISP=SHR     
//SYSTOTAL DD SYSOUT=*                                       
//DD01      DD DSN=RIS01U.POASECU.ESSAI.INPUT,DISP=SHR       
//DD01O     DD DSN=RIS01U.POASECU.ESSAI.OUTPUT,DISP=OLD       
//SYSIN    DD *                                               
$$DD01 COPY IF=(5,0,C'TORONTO')                               
/*                                                           
//*                                                           
//STEP3 EXEC PGM=FILEAID                                     
//SYSPRINT DD SYSOUT=*                                       
//SYSLIST  DD DSN=RIT01U.POAACF2.PRIV.FIL.BEFORE,DISP=SHR     
//SYSTOTAL DD SYSOUT=*                                       
//DD01      DD DSN=RIS01U.POASECU.ESSAI.OUTPUT,DISP=SHR       
//SYSIN    DD *                                             
$$DD01 UPDATE F=JCL,EDITALL=(3,0,C"TORONTO",C"DOWNTOWNAREA")
/*                                                         
//* 


So how can I take members of input and merge them with output into "Merge"

Any idea how to process this?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Tue Dec 15, 2020 1:40 pm
Reply with quote

Why not just unload the PDS and run a SORT w/ OUTFIL to create multiple lines against them? You can review all changes before reloading.
Back to top
View user's profile Send private message
ThecknoDecker

New User


Joined: 15 Dec 2020
Posts: 2
Location: Canada

PostPosted: Wed Dec 16, 2020 3:17 am
Reply with quote

Well thanks all I found it!

Code:
//STEP2 EXEC PGM=FILEAID                                           
//SYSPRINT DD SYSOUT=*                                             
//SYSLIST  DD SYSOUT=*                                             
//SYSTOTAL DD SYSOUT=*                                             
//DD01      DD DSN=RIS01U.POASECU.ESSAI.INPUT,DISP=SHR             
//FILE01    DD DSN=RIS01U.POASECU.ESSAI.OUTPUT,DISP=OLD             
//SYSIN    DD *                                                       
$$DD01 USER WRITE=FILE01,                                             
            IF=(5,0,C'TORONTO'),                               
            WRITE=FILE01                                               
/*                                                                     
//* 


In that part, it reads once the file and writes it to File01,
Then it reads it again and prints only the "Toronto" lines...

What is perplexing is that the lines end up not at the end of the file but below the lines where we find a Toronto...
For exemple line 12 is copied in line 13... 17 in 18...

Now to finish my job I do an update with a select=2 so only 1 of the 2 lines is modified.

Code:
//STEP3 EXEC PGM=FILEAID                                               
//SYSPRINT DD SYSOUT=*                                                 
//SYSLIST  DD SYSOUT=*                                                 
//SYSTOTAL DD SYSOUT=*                                                 
//DD01     DD DSN=RIS01U.POASECU.ESSAI.OUTPUT,DISP=SHR               
//SYSIN    DD *                                                       
$$DD01 UPDATE F=JCL,                                                   
               EDITALL=(3,0,C"TORONTO",C"DOWNTOWNAREA"),   
               SELECT=2                                               
/*                                                                     
//*

Thanks you all it's by reading a lot of your post and the manual that I found it.

ThecknoDecker[/code]
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Compuware & Other Tools

 


Similar Topics
Topic Forum Replies
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts batch SFTP job using AOPBATCH unable ... All Other Mainframe Topics 7
No new posts Repeat n times by substuting SEQNUM i... DFSORT/ICETOOL 2
No new posts how to eliminate null indicator value... DB2 7
No new posts Call an hlasm from REXX in batch and ... CLIST & REXX 4
Search our Forums:

Back to Top