Update 1 record of multiple with OVERLAY

IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER
golemis
Posts: 34
Joined: Wed Apr 04, 2018 8:13 pm
Skillset: z/OS, REXX, DB2, CICS, MQ, ISPF, DFSMS
Referer: google
Location: London, UK

Update 1 record of multiple with OVERLAY

Postby golemis » Fri Feb 07, 2020 7:44 pm

Hi team,

I have a dataset (VB(90)) in which the records are like:

    Y AAA BBB
    N CCC DDD
    N EEE FFF
    N GGG HHH

I need to update the first record with a "N" in first collumn, with a "Y" leaving all other record intact

Tried :

Code: Select all

 OPTION COPY,STOPAFT=1,VLSHRT
  RECORD TYPE=V,LENGTH=90
  INCLUDE COND=(5,1,SS,EQ,C'N')
  OUTFIL OVERLAY=(5:5,1,CHANGE=(1,C'N',C'Y'))


But this gives me as output only the updated record, in which case is the second one (correct). How can I get the whole file updated ?

Thanks GG

golemis
Posts: 34
Joined: Wed Apr 04, 2018 8:13 pm
Skillset: z/OS, REXX, DB2, CICS, MQ, ISPF, DFSMS
Referer: google
Location: London, UK

Re: Update 1 record of multiple with OVERLAY

Postby golemis » Fri Feb 07, 2020 8:01 pm

Tried 3 different sort steps, one for all Y, then the overlayed, and then the remaining N's, and the idea is to concatenate them at the end. However for the remaining N's, there is no STARTAFT=2 in the OPTION parameter. how can I skip the updated (overlayed) record, so I will not have it twice in the output ?

golemis
Posts: 34
Joined: Wed Apr 04, 2018 8:13 pm
Skillset: z/OS, REXX, DB2, CICS, MQ, ISPF, DFSMS
Referer: google
Location: London, UK

Re: Update 1 record of multiple with OVERLAY

Postby golemis » Fri Feb 07, 2020 9:35 pm

I think I've done it:
1st sort

Code: Select all

 OPTION COPY,VLSHRT
  RECORD TYPE=V,LENGTH=90
  OUTFIL FNAMES=SORTOUT,INCLUDE=(5,1,SS,EQ,C'Y')
  OUTFIL FNAMES=SORTO2,INCLUDE=(5,1,SS,NE,C'Y')

2nd have the SORTO2 as SORTIN:

Code: Select all

 OPTION COPY,STOPAFT=1,VLSHRT
  RECORD TYPE=V,LENGTH=90
  INCLUDE COND=(5,1,SS,EQ,C'N')
  OUTFIL OVERLAY=(5:5,1,CHANGE=(1,C'N',C'Y'))

and 3rd again the SORTO2 of 1st step as SORTIN

Code: Select all

 OPTION COPY,SKIPREC=1,VLSHRT
  RECORD TYPE=V,LENGTH=90
  INCLUDE COND=(5,1,SS,EQ,C'N')


Seems to be working as expected. I would appreciate any comments on things I might have overseen, or missed.

Thanks GG


  • Similar Topics
    Replies
    Views
    Last post