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
 

 

Timestamp compare in SORT

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

New User


Joined: 14 Jun 2012
Posts: 70
Location: India

PostPosted: Tue Oct 22, 2013 11:08 am    Post subject: Timestamp compare in SORT
Reply with quote

Hi Friends,

I have a file unloaded from DB. It contains create time stamp in it.

I need to compare this timestamp with static timestamp (2013-08-27-00.00.00.000000) and write two files with records created after the static timestamp and before the timestamp.

Please help to understand how can I do it using Sort.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Tue Oct 22, 2013 11:55 am    Post subject: Reply to: Timestamp compare in SORT
Reply with quote

You want one OUTFIL with INCLUDE= for one of the conditions on your timestamp.

You want another OUTFIL with either SAVE, OMIT= or INCLUDE= depending on whether you can stand the chance of an exact hit on your value or not.
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 70
Location: India

PostPosted: Tue Oct 22, 2013 12:37 pm    Post subject:
Reply with quote

I tested it as below.

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
2000-08-31-17.28.43.6341012013-08-27-00.00.00.000000
2000-12-22-12.00.40.1153662013-08-27-00.00.00.000000
2013-09-05-23.49.13.0361782013-08-27-00.00.00.000000
2013-08-28-16.19.10.9933222013-08-27-00.00.00.000000
2013-08-29-15.48.58.2846922013-08-27-00.00.00.000000
2013-07-18-21.52.02.2495542013-08-27-00.00.00.000000
2013-01-22-13.03.57.0813732013-08-27-00.00.00.000000
2013-10-10-07.38.37.5258382013-08-27-00.00.00.000000
2001-01-26-12.15.35.2091982013-08-27-00.00.00.000000
2013-08-30-16.13.47.7891362013-08-27-00.00.00.000000
/*
//OUT1 DD DSN=HLQ.TIMESORT.OUT1,
// DISP=(NEW,CATLG,DELETE),
// RECFM=FB,
// UNIT=SYSDA,
// DATACLAS=HUGE
//OUT2 DD DSN=HLQ.TIMESORT.OUT2,
// DISP=(NEW,CATLG,DELETE),
// RECFM=FB,
// UNIT=SYSDA,
// DATACLAS=HUGE
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,INCLUDE=(1,26,UFF,GT,27,26,UFF)
OUTFIL FNAMES=OUT2,SAVE
/*

But here, I need to append the static timestamp in my file before sort. Can I do it without appending the value, is it possible to code it directly in Include?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Tue Oct 22, 2013 1:02 pm    Post subject: Reply to: Timestamp compare in SORT
Reply with quote

Yes. You can include it as a literal. Or you can make a symbol/SYMNAME. Or use the JPn from the PARM.
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 70
Location: India

PostPosted: Tue Oct 22, 2013 1:32 pm    Post subject:
Reply with quote

Below didnot work. All records were written to OUT2.

OPTION COPY
OUTFIL FNAMES=OUT1,
INCLUDE=(1,26,UFF,GE,2013-08-27-00.00.00.000000)
OUTFIL FNAMES=OUT2,SAVE

What is wrong in the card?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Tue Oct 22, 2013 1:46 pm    Post subject: Reply to: Timestamp compare in SORT
Reply with quote

Change UFF to CH and put C' at the left of your timestamp and ' at the right, to make it a character literal.
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 70
Location: India

PostPosted: Tue Oct 22, 2013 3:10 pm    Post subject:
Reply with quote

Thanks a lot Bill. It worked.
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 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
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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