View previous topic :: View next topic
Author
Message
pnr kishore New User Joined: 29 May 2008Posts: 15 Location: CHENNAI
Hi
My input file contains the records with the date and my requirement is to extract those records from the file that corresponds to a particular month and year taken from system date.
Input file:
ADARLINGE 02/23/2009
APTESTSPE 02/23/2009
BBROWN2 E 02/23/2009
CHAGEN E 01/23/2009
DTABALBAE 01/21/2009
output should contains the records corresponding to Feb2009 (current system date)
output required:
ADARLINGE 02/23/2009
APTESTSPE 02/23/2009
BBROWN2 E 02/23/2009
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
pnr kishore,
Welcome to the forums. The below SyncSort job works for your requirement. I have assumed an FB input of LRECL=80 . You can change it as per your file attributes. Post back if you have any issues. Good luck
Code:
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
----+----1----+----2----+----3----+----4----+----5----+----6
//SORTIN DD *
ADARLINGE 02/23/2009
APTESTSPE 02/23/2009
BBROWN2 E 02/23/2009
CHAGEN E 01/23/2009
DTABALBAE 01/21/2009
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(81:&DATE2)
OUTFIL INCLUDE=(17,4,CH,EQ,81,4,CH,AND,11,2,CH,EQ,85,2,CH)
SORTOUT
Code:
ADARLINGE 02/23/2009
APTESTSPE 02/23/2009
BBROWN2 E 02/23/2009
Back to top
pnr kishore New User Joined: 29 May 2008Posts: 15 Location: CHENNAI
Thanks Alot It worked Fine..
Back to top
eytellene New User Joined: 19 May 2009Posts: 16 Location: Philippines
Is OVERLAY command applicable to input file set as PS? Since I want to do the same but the input file is set as a datase...
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello and welcome to the forum,
Yes. Most input is a ps dataset.
If there is something i am missing, please clarify.
Back to top
eytellene New User Joined: 19 May 2009Posts: 16 Location: Philippines
thanks for the reply..
actually I cannot test what I have since I am just basing on the syntax from this forum..
will it be okay if you can check if my syntax is okay.. I'll be having my ID by next month so I am really battling on this
//PS020 EXEC PGM=SYNCSORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= input file,
// DISP=SHR
//SORTOUT DD DSN=output file
// DISP=(NEW,CATLG,DELETE),
// DSORG=PS,
// RECFM=FBA,
// LRECL=69,
// BLKSIZE=0,
// DATACLAS=STANDARD
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,150)
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,150)
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,150)
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,150)
//SORTWK05 DD UNIT=SYSDA,SPACE=(CYL,150)
//*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=OUT,
INREC OVERLAY=(70:&DATE2)
INCLUDE=(46,02,CH,EQ,74,2,CH,AND,
52,04,CH,EQ,70,4,CH)
TRAILER1=(01:'ITD ALL MM',
11:COUNT15),
NODETAIL
and lastly I am trying to retrieve the system date and stored it in a temporary file this is the JCL
//PS040 EXEC PGM=SYNCSORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY RECORD
//SORTOUT DD DSN=&&TEMP3
// DISP=(NEW,PASS,DELETE),
// DSORG=PS,
// RECFM=FBA,
// LRECL=80,
// BLKSIZE=0
// DATACLAS=STANDARD
//*
//SYSIN DD *
OPTION COPY
INREC BUILD=(&DATE2)
//*
Thanks in advance
Back to top
Please enable JavaScript!