Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT extraction of records that matches with systemdate

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT extraction of records that matches with systemdate
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: 2285
Location: @my desk

PostPosted: Wed Feb 25, 2009 6:14 pm    Post subject:
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    Post subject: Reply to: SYNCSORT extraction of records that matches with s
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    Post subject:
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

Site Director


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

PostPosted: Fri May 22, 2009 10:16 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us