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

Date comparison


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

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Thu Oct 22, 2009 4:55 pm
Reply with quote

Hi,

In my file I have to date fields Like below -

Code:
Start-Date______________End-date
(AN)                                   (AN)
01/01/2004                       31/12/2004
01/01/2005                       31/12/2005
...
...
01/01/2011                       31/12/2011
Code'd
All are alphanumeric data.
I want to get all the values between start-date 01/01/2006 and end-date 31/12/2010 using ICETOOL.

How can this be done?
Back to top
View user's profile Send private message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Thu Oct 22, 2009 5:26 pm
Reply with quote

abhishek mitra wrote:
Hi,

In my file I have to date fields Like below -

Start-Date______________End-date
(AN) (AN)
01/01/2004_____________31/12/2004
01/01/2005_____________31/12/2005
...
...
01/01/2011_____________31/12/2011

All are alphanumeric data.
I want to get all the values between start-date 01/01/2006 and end-date 31/12/2010 using ICETOOL.

How can this be done?


just edited the input for better visual presentation.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Oct 22, 2009 9:31 pm
Reply with quote

abhishek mitra,

Use the following DFSORT JCL . I assumed that your input is FB and lrecl of 80. You just need to re-arrange the dates in CCCYMMDD format and then use INCLUDE cond on outfil

Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                       
01/01/2004 31/12/2004   DROP                           
01/01/2005 31/12/2005   DROP                           
01/01/2006 31/12/2006   PICK                           
01/01/2007 31/12/2007   PICK                           
01/01/2008 31/12/2008   PICK                           
01/01/2009 31/12/2009   PICK                           
01/01/2010 31/12/2010   PICK                           
01/01/2011 31/12/2011   DROP                           
01/01/2012 31/12/2012   DROP                           
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                     
  INREC OVERLAY=(81:7,4,4,2,1,2,X,18,4,15,2,12,2)     
  OUTFIL BUILD=(1,80),                                 
  INCLUDE=(81,8,ZD,GE,20060101,AND,90,8,ZD,LE,20101231)
/*


The output of this job is
Code:

01/01/2006 31/12/2006   PICK
01/01/2007 31/12/2007   PICK
01/01/2008 31/12/2008   PICK
01/01/2009 31/12/2009   PICK
01/01/2010 31/12/2010   PICK
Back to top
View user's profile Send private message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Fri Oct 23, 2009 1:44 pm
Reply with quote

Can you please put a few words explaining DROP and PICK? I haven't use it anyday.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Oct 23, 2009 1:53 pm
Reply with quote

Hi,

I guess DROP and PICK are just indicators, to have a better viewing of output.
They are not statements or options.(Which I too thought were options initially icon_wink.gif )

Regards,
Back to top
View user's profile Send private message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Fri Oct 23, 2009 2:06 pm
Reply with quote

vasanthz wrote:
Hi,

I guess DROP and PICK are just indicators, to have a better viewing of output.
They are not statements or options.(Which I too thought were options initially icon_wink.gif )

Regards,


GR8 icon_lol.gif

Thanks to both of you for your kind attention.
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top