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

Current Timestamp in JCL


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

New User


Joined: 16 Oct 2012
Posts: 37
Location: INDIA

PostPosted: Wed Apr 03, 2013 2:49 pm
Reply with quote

Hi,

I have to fetch current timestamp in JCL so as to filter out records which have BEGIN-TIMESTAMP greater than the current timestamp.

I am currently using DATE4 function in INCLUDE COND, but DATE4 doesnt provide the complete timestamp, it only gives the current date + time (hh:mm:ss) i.e., 19 bytes. I want whole 26 bytes of current timestamp for comparison. Is there any alternative ?

Code:


INCLUDE COND=(7,19,CH,GT,DATE4)

                       
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 03, 2013 3:23 pm
Reply with quote

Can you outline the business reason for your processing?
Back to top
View user's profile Send private message
frozenblood
Warnings : 1

New User


Joined: 16 Oct 2012
Posts: 37
Location: INDIA

PostPosted: Wed Apr 03, 2013 3:45 pm
Reply with quote

I want to filter only those records from the file whose begin timestamp is greater than or equal to the current timestamp i.e., those records which will be active in future.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 03, 2013 4:12 pm
Reply with quote

No, that's just restating what you have already said.

I'm sure the business requirement says nothing like that.

You will end up with a step which cannot be re-run (will produce different output) and which can't be run twice. If this is a once-off, OK, but then what would be the reason for the cut-off point being "when the SORT gets the timestamp"?
Back to top
View user's profile Send private message
frozenblood
Warnings : 1

New User


Joined: 16 Oct 2012
Posts: 37
Location: INDIA

PostPosted: Wed Apr 03, 2013 4:20 pm
Reply with quote

Actually the requirement is to filter out only the active records which includes future dated records. So the future dated records might have begin timestamp in nano sceonds(full 26 bytes), so if we filter only with 19 bytes timestamp we might miss the future records.

Please let us know if you have any alternative Thanks!
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 03, 2013 4:40 pm
Reply with quote

Well, I've had a couple of shots at it, but leaving it now.

DFSORT has DATE5 which does what you want.

SyncSort does not. Suggest you find "something" to write a timestamp to a file, then get back to what to do with it.
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Wed Apr 03, 2013 5:01 pm
Reply with quote

DATE5 has 26 bytes.

DATE4 timestamp:
ccyy-mm-dd-hh.mm.ss

DATE5 timestamp:
ccyy-mm-dd-hh.mm.ss.nnnnnn
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 03, 2013 5:37 pm
Reply with quote

But TS has SyncSort, and SyncSort doesn't have DATE5, as I've already said.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Apr 03, 2013 5:43 pm
Reply with quote

What if your SORT job runs different time everyday(due to some reasons..may be beacuse of CPU unavaliablity..Dependency on other jobs..in case of abends).

Are you sure your filtering condition would give you the required output?
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 To get the count of rows for every 1 ... DB2 3
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Changeman - how can we know the curr... Compuware & Other Tools 2
No new posts Fetch data from programs execute (dat... DB2 3
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
Search our Forums:

Back to Top