View previous topic :: View next topic
|
Author |
Message |
eytellene
New User
Joined: 19 May 2009 Posts: 16 Location: Philippines
|
|
|
|
Can a JCL particularly syncsort also get the last month's details in an input file?
Thanks |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
eytellene
New User
Joined: 19 May 2009 Posts: 16 Location: Philippines
|
|
|
|
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 |
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Dick,
I wonder why people do this kind of "help" |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
|