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
 

 

Extract last 3 hours of data using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Thu Jan 09, 2014 2:20 pm    Post subject: Extract last 3 hours of data using SORT
Reply with quote

Hi All,

I have the field of packed decimal S9(7) comp-3 which will have the creation time (ex: 121703 HHMMSS) in the Input file. My requirement is to fetch the records which are created in last 3 hours (current job run time - 3 hours).

I tried searching the manual and also in forum, and couldn't find any. I can use TIME1P but cannot subtract hours in that (as we do for DATE2P-3 which gives last 3 days records).

Could you please help? Thanks.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Jan 09, 2014 2:40 pm    Post subject:
Reply with quote

Check SYMNAMES

Code:
HHMMSS,S'&HHMMSS'


Gives you the time and do a difference and see if the difference of hours is greater than OR equal to 3

Then pick those records
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7235

PostPosted: Thu Jan 09, 2014 2:43 pm    Post subject: Reply to: Extract last 3 hours of data using SORT
Reply with quote

You show 12 digits and a field which can only contain seven. How does that work?
Back to top
View user's profile Send private message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Thu Jan 09, 2014 4:28 pm    Post subject:
Reply with quote

Thanks Pandora, I will try this.

@Bill, I think we had some misunderstanding. It is a 4 byte field since 9(7) Comp-3, and it will contains the values in HHMMSS format; ex: 145802 (Hex format: 0145802C).
Back to top
View user's profile Send private message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Thu Jan 09, 2014 4:49 pm    Post subject:
Reply with quote

In Btw, so is there no function available in DFSORT to TIME function (current time - n hrs/min/sec time) similar to DATE2P function (current date - n days) ?
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unwrap the data based on delimiter X'25' bhavana yalavarthi DFSORT/ICETOOL 18 Fri Dec 09, 2016 10:25 am
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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