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

need to get previous date


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

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Thu Apr 29, 2010 9:34 am
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 29, 2010 1:41 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Apr 29, 2010 2:16 pm
Reply with quote

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
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Thu Apr 29, 2010 2:20 pm
Reply with quote

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
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Thu Apr 29, 2010 2:24 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Apr 29, 2010 7:15 pm
Reply with quote

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
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top