|
View previous topic :: View next topic
|
| Author |
Message |
ThecknoDecker
New User
Joined: 15 Dec 2020 Posts: 2 Location: Canada
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1424 Location: Bamberg, Germany
|
|
|
|
| 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 |
|
 |
ThecknoDecker
New User
Joined: 15 Dec 2020 Posts: 2 Location: Canada
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|