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

Syncsort - select last month's records


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

New User


Joined: 19 May 2009
Posts: 16
Location: Philippines

PostPosted: Thu May 28, 2009 7:26 am
Reply with quote

Can a JCL particularly syncsort also get the last month's details in an input file?

Thanks icon_smile.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: Thu May 28, 2009 7:43 am
Reply with quote

Hello,

Quote:
get the last month's details in an input file
Please clarify.

It will help if you show some sample input data and the output you want from that input.
Back to top
View user's profile Send private message
eytellene

New User


Joined: 19 May 2009
Posts: 16
Location: Philippines

PostPosted: Thu May 28, 2009 8:43 am
Reply with quote

input :

01/10/2009 12345678
01/11/2009 12345679
02/20/2009 44444444
03/02/2009 11111111
03/05/2009 22222222
04/04/2009 33333333
04/10/2009 44444444
04/15/2009 55555555
05/04/2009 66666666
05/11/2009 77777777

Desired output since today is May get all records in April

04/04/2009 33333333
04/10/2009 44444444
04/15/2009 55555555

Is this possible in JCL?

Thanks icon_smile.gif
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu May 28, 2009 9:30 am
Reply with quote

Hi eytellene,
Try this,

Code:
SORT FIELDS=(1,2,CH,D)
INREC OVERLAY=(20:SEQNUM,3,ZD,RESTART=(1,2))
INCLUDE COND=(20,3,CH,EQ,C'001')
OUTREC FIELDS=(1,20)

This code is not tested.Please let me know if you have any issues.
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: Thu May 28, 2009 9:33 am
Reply with quote

Hello,

What is that code supposed to do?

Please do not just "toss things in".

The request is to select records from "last month". What does the posted code have to do with selecting records from last month. . .
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu May 28, 2009 9:55 am
Reply with quote

Hi Dick,

I wonder why people do this kind of "help"
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: Thu May 28, 2009 10:03 am
Reply with quote

Hi Arun,

I suspect that many people really want to make a contribution, but have not thoroughly thought thru their "solution". It is unfortunate when one has something to offer, but no way to test it.

We also have times when the request is confusing (which i'd not believe is the case here - seems rather clear unless i misunderstand).

Now, if we can get some help on what Eytellene wants to do. . .
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu May 28, 2009 12:10 pm
Reply with quote

eytellene,

The below SyncSort job does what you asked for. Note that the CENTWIN parameter has been set to 1950 which allows comparison of years in the range 1950-2049.
Code:
//STEP1  EXEC  PGM=SORT,PARM='CENTWIN=1950'           
//SYSOUT   DD  SYSOUT=*                               
//SORTIN   DD *                                       
01/10/2009 12345678                                   
01/11/2009 12345679                                   
02/20/2009 44444444                                   
03/02/2009 11111111                                   
03/05/2009 22222222                                   
04/04/2009 33333333                                   
04/10/2009 44444444                                   
04/15/2009 55555555                                   
05/04/2009 66666666                                   
05/11/2009 77777777                                   
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD  *                                     
  INREC OVERLAY=(81:1,2,9,2)                         
  SORT FIELDS=COPY                                   
  OUTFIL INCLUDE=(81,4,Y2W,EQ,Y'DATE2'-1),BUILD=(1,80)
/* 
SORTOUT
Code:
04/04/2009 33333333
04/10/2009 44444444
04/15/2009 55555555
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 Populate last day of the Month in MMD... SYNCSORT 2
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 JCL sort card - get first day and las... JCL & VSAM 9
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top