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
 

 

need to get previous date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: need to get previous date
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: 2150
Location: At my coffee table

PostPosted: Thu Apr 29, 2010 1:41 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Apr 29, 2010 2:16 pm    Post subject: Re: need to get previous date
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    Post subject: Reply to: need to get previous date
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    Post subject:
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

Site Director


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

PostPosted: Thu Apr 29, 2010 7:15 pm    Post subject:
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    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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


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