Page 1 of 1
copy next record
Posted:
Tue Mar 16, 2010 1:14 am
by rayngerfan
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.
Re: copy next record
Posted:
Tue Mar 16, 2010 1:24 am
by dick scherrer
Hello,
Because that is where you specified the sequence number be placed.
Re: copy next record
Posted:
Tue Mar 16, 2010 1:29 am
by MrSpock
You should probably PUSH to column 81.
Re: copy next record
Posted:
Tue Mar 16, 2010 3:24 am
by rayngerfan
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)
Re: copy next record
Posted:
Tue Mar 16, 2010 3:29 am
by dick scherrer
Hello,
As MrSpock suggested:
You should probably PUSH to column 81.
You would also test pos 81 but build only to 80.
Re: copy next record
Posted:
Tue Mar 16, 2010 7:23 am
by rayngerfan
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
Re: copy next record
Posted:
Tue Mar 16, 2010 8:52 am
by dick scherrer
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.
Re: copy next record
Posted:
Tue Mar 16, 2010 4:14 pm
by rayngerfan
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.
Re: copy next record
Posted:
Tue Mar 16, 2010 11:12 pm
by dick scherrer
Good to hear it is working - thanks for letting us know and posting your solution
d