copy next record



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

copy next record

Postby rayngerfan » Tue Mar 16, 2010 1:14 am

I WANT TO FIND A STRING OF DATA AND THEN COPY THE NEXT RECORD AFTER THE STRING HAS BEEN FOUND. I'm using the below jcl, which works, but I'm not sure why I'm getting a '2' in column 80 of the OPF.

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=PLREP12.PROD.FILE,DISP=SHR
//SORTOUT DD DSN=PLREP12.TEST.SRT.NEW,DISP=(,CATLG,DELETE),
//  UNIT=TEST,SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(4,26,CH,EQ,
  C'CONTACT PERSON ON CALL FOR'),
    RECORDS=2,PUSH=(80:SEQ=1))
  OUTFIL INCLUDE=(80,1,CH,EQ,C'2'),BUILD=(1,80)
/*


Input file. text starts in col 4
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
* CONTACT PERSON ON CALL FOR      *
* PRODUCTION SUPPORT GROUP        *


output file contains the next record, but there is the number 2 in col 80. I'm not sure why the number 2 would be in col 80.

 * PRODUCTION SUPPORT GROUP         *                                                2


Any help is greatly appreciated.
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: copy next record

 

Re: copy next record

Postby dick scherrer » Tue Mar 16, 2010 1:24 am

Hello,

Because that is where you specified the sequence number be placed.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: copy next record

Postby MrSpock » Tue Mar 16, 2010 1:29 am

You should probably PUSH to column 81.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: copy next record

Postby rayngerfan » Tue Mar 16, 2010 3:24 am

The RECORDS=2 will select the next record after the text is found. If the RECORDS parameter is change to 3 and the OUTFIL INCLUDE=(80,1,CH,EQ,C'3'),BUILD=(1,80) then the 3rd record is selected after the text and a '3' is put in col 80.

What paramters would I change to just copy the next record without putting any number in column 80???

RECORDS=2,PUSH=(80:SEQ=1))
OUTFIL INCLUDE=(80,1,CH,EQ,C'2'),BUILD=(1,80)
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: copy next record

Postby dick scherrer » Tue Mar 16, 2010 3:29 am

Hello,

As MrSpock suggested:
You should probably PUSH to column 81.


You would also test pos 81 but build only to 80.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: copy next record

Postby rayngerfan » Tue Mar 16, 2010 7:23 am

Hi Dick

I changed the PUSH parameter to column 81 and the job gets a RC=0, but the OPF is empty.

INREC IFTHEN=(WHEN=GROUP,BEGIN=(4,26,CH,EQ,
C'CONTACT PERSON ON CALL FOR'),
RECORDS=2,PUSH=(81:SEQ=1))
OUTFIL INCLUDE=(80,1,CH,EQ,C'2'),BUILD=(1,80)
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 27920
WER257I INREC RECORD LENGTH = 81
WER238I POTENTIALLY INEFFICIENT USE OF INREC
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 27920
WER405I SORTOUT : DATA RECORDS OUT 0; TOTAL RECORDS OUT 0
WER054I RCD IN 13, OUT 13
WER169I RELEASE 1.3 BATCH 0494 TPF LEVEL 2.0
WER052I END SYNCSORT - TBRIRAN4,S1,,DIAG=A800,738C,8024,00CC,E0CA,4D82,8268,4E
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: copy next record

Postby dick scherrer » Tue Mar 16, 2010 8:52 am

Hello,

Because you put the value in 81 and then tested for the value in 80. . .

From earlier:
You would also test pos 81 but build only to 80.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: copy next record

Postby rayngerfan » Tue Mar 16, 2010 4:14 pm

Hi Dick

I was able to get the records desired without adding the record=2 NUMBER to col 80.

INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,64,CH,EQ,
C'----------------- TRIGGERED BY JOBS/DATASETS/NETWORKS ----------'),
RECORDS=2,PUSH=(81:SEQ=1))
OUTFIL INCLUDE=(81,1,CH,EQ,C'2'),BUILD=(1,80)
WER108I SORTIN : RECFM=FBA ; LRECL= 100; BLKSIZE= 27900
WER257I INREC RECORD LENGTH = 100
WER110I SORTOUT : RECFM=FBA ; LRECL= 80; BLKSIZE= 27920
WER405I SORTOUT : DATA RECORDS OUT 4; TOTAL RECORDS OUT 4
WER054I RCD IN 16, OUT 16
WER169I RELEASE 1.3 BATCH 0494 TPF LEVEL 2.0

Thanks for your help.
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: copy next record

Postby dick scherrer » Tue Mar 16, 2010 11:12 pm

Good to hear it is working - thanks for letting us know and posting your solution :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post