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 - select last month's records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - select last month's records
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

Site Director


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

PostPosted: Thu May 28, 2009 7:43 am    Post subject:
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    Post subject:
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: 208
Location: Cochin/Kerala/India

PostPosted: Thu May 28, 2009 9:30 am    Post subject:
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

Site Director


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

PostPosted: Thu May 28, 2009 9:33 am    Post subject:
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: 2180
Location: @my desk

PostPosted: Thu May 28, 2009 9:55 am    Post subject:
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

Site Director


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

PostPosted: Thu May 28, 2009 10:03 am    Post subject:
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: 2180
Location: @my desk

PostPosted: Thu May 28, 2009 12:10 pm    Post subject:
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    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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


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