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

Extraction of data between date ranges.


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

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Tue Dec 20, 2005 8:00 pm
Reply with quote

Hi All,

I have a requirement. I need to compare the dates in a dataset (i.e. the records that fall between the current date and current date+16 days) and extract those records.

I'm stucking at how to get current date+16 day.

Please let me know if it possible. I'm using INCLUDE OPTION.

Date format is YYDDD.

Regards
Jai
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 20, 2005 10:23 pm
Reply with quote

DFSORT doesn't have a built-in function for relative dates, but you can use REXX to create a DFSORT symbol for the relative date that you can use. For an example, see:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst03.html#t7r

I'm not a REXX expert, so I can't tell you how to do it for different types of dates, but I'm sure one of the REXX experts could if you don't know how to do it yourself.
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Tue Dec 20, 2005 10:41 pm
Reply with quote

Let us know if you want some more help on this

Alain
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Tue Dec 20, 2005 10:49 pm
Reply with quote

Hi Alian,

I don't have idea on rexx as frank suggested to use, but also there is no bulit in function in sort.

Can you help me how to proceed, if possible using sort.

Thanks & Regards
Jai
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Thu Dec 22, 2005 9:41 pm
Reply with quote

Here is what you are looking for.
I modified the rexx from
search390.techtarget.com/tip/1,289483,sid10_gci817030,00.html
to your specific need.
Play with ADD_DAYS to do your own tests.
I have coded some SAY in the rexx to check the result.
At this time DATE rexx function in MVS (and VM) can't do that as easily as shown in the Frank's smart trick.
So, that's why I was late to reply to your need : I have opened 2 PMR (?) to suggest the rexx team to implement this.
I wait for the feedback if they accept or not to extend that 'new' functions in VM & MVS.
Code:

/* REXX */
ADD_DAYS=9
Julian_Date=SUBSTR(DATE("S",DATE("B")+ADD_DAYS,"B"),3,2)!!RIGHT(DATE("B",DATE("B")+ADD_DAYS,"B")-DATE("B",SUBSTR(DATE("S",DATE("B")+ADD_DAYS,"B"),1,4)"0101","S")+1,3,"0")

say "Standard Date: "DATE("S",Julian_Date,"J")
say "european Date: "DATE("E",Julian_Date,"J")
say "USA Date     : "DATE("U",Julian_Date,"J")
say "Julian Date  : "Julian_Date

QUEUE "JDATE,C'"Julian_Date"'"
"EXECIO 1 DISKW OUT"

Here is a sample:
Code:

//STEP0001 EXEC PGM=IKJEFT01,PARM=(XDATE)
//SYSEXEC  DD DISP=SHR,DSN=...
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//OUT      DD DSN=&&OUT,
//            DISP=(NEW,PASS,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK,(1,0,0)),
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80)
//SYSTSIN  DD DUMMY
//*
//STEP0002 EXEC PGM=ICETOOL
//DFSMSG   DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//SYMNAMES DD DSN=&&OUT,DISP=(SHR,DELETE,DELETE)
//TOOLIN   DD *
  COPY FROM(IN) TO(OUTX) USING(ICE0)
/*
//IN       DD *
05350
05360
06001
06002
/*
//OUTX     DD SYSOUT=*
//ICE0CNTL DD *
  INCLUDE COND=(1,5,CH,GE,JDATE)
/*

Alain
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Apr 22, 2006 5:01 am
Reply with quote

Quote:
DFSORT doesn't have a built-in function for relative dates


It does now with z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006). For example:

Code:

  INCLUDE COND=(1,5,Y2T,GE,Y'DATE3',AND,   
    1,5,Y2T,LE,Y'DATE3'+16)                 


For complete details on comparing and inserting past and future dates, see:

Use [URL] BBCode for External Links
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 Store the data for fixed length COBOL Programming 1
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top