View previous topic :: View next topic
|
Author |
Message |
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
HI All,
I have a requirement say the previous year data should only
be extracted thru syncsort..to acheive this we are hardcoding the
year in INCLUDE of sort.
Instead how can i do this without hard coding.
Hope I m clear. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
What does your current hardcoded INCLUDE look like?
Have you looked into Syncsort's current data functions?
SyncSort for z/OS 1.3 Programmer’s Guide wrote: |
Current Date Constant Specification:
You can compare fields to the date of a SyncSort run or the date of the run with an offset in addition to decimal fields and binary, character, and hexadecimal strings. Thus, records can more easily be included or omitted based on whether their dates are equal to, less than, or greater than the run date or the run date with an offset. |
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
murugan_mf wrote: |
..to acheive this we are hardcoding the
year in INCLUDE of sort.
Instead how can i do this without hard coding. |
That' your program, that's your logic - you can do anything!
And when you say
Quote: |
the previous year data should only be extracted thru syncsort.. |
Do you mean data which is 365 days old or you are concerned about only century part - as for example, data of Dec 31, 2009 can be one year old for todays' date if I talk about only century-part 2010? Is there any need to think about leap years? |
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
I am really sorry for mis-leading..this is not for syncsort this fileaid in batch.
INCLUDE look like this
Code: |
INCLUDE COND=(20,4,EQ,'2009') |
Here 2009 is the year..so instead of hardcoding i need a func like so that it takes previous year. |
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
Anuj..One of the field in the format MM/DD/YYYY
so i need those records which is 2009 in one file...2010 in another |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Instead of having the INCLUDE instream, create the INCLUDE from the current date using your own code (any language will do), write it to a dasd file and use this file as part of the control statements. |
|
Back to top |
|
|
|