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

Timestamp compare in SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Tue Oct 22, 2013 11:08 am
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

Moderator Emeritus


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

PostPosted: Tue Oct 22, 2013 11:55 am
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: 96
Location: India

PostPosted: Tue Oct 22, 2013 12:37 pm
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

Moderator Emeritus


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

PostPosted: Tue Oct 22, 2013 1:02 pm
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: 96
Location: India

PostPosted: Tue Oct 22, 2013 1:32 pm
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

Moderator Emeritus


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

PostPosted: Tue Oct 22, 2013 1:46 pm
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: 96
Location: India

PostPosted: Tue Oct 22, 2013 3:10 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
Search our Forums:

Back to Top