IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT extraction of records that matches with systemdate


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pnr kishore

New User


Joined: 29 May 2008
Posts: 15
Location: CHENNAI

PostPosted: Wed Feb 25, 2009 4:47 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Feb 25, 2009 6:14 pm
Reply with quote

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 icon_smile.gif
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
View user's profile Send private message
pnr kishore

New User


Joined: 29 May 2008
Posts: 15
Location: CHENNAI

PostPosted: Wed Feb 25, 2009 7:18 pm
Reply with quote

icon_biggrin.gif
Thanks Alot It worked Fine..
Back to top
View user's profile Send private message
eytellene

New User


Joined: 19 May 2009
Posts: 16
Location: Philippines

PostPosted: Fri May 22, 2009 10:10 am
Reply with quote

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... icon_biggrin.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 22, 2009 10:16 am
Reply with quote

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
View user's profile Send private message
eytellene

New User


Joined: 19 May 2009
Posts: 16
Location: Philippines

PostPosted: Fri May 22, 2009 10:37 am
Reply with quote

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 icon_confused.gif

//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 icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top