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
 

 

Extraction of data between date ranges.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Extraction of data between date ranges.
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 Moderator


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

PostPosted: Tue Dec 20, 2005 10:23 pm    Post subject:
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:

http://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    Post subject: Re: Extraction of data between date ranges.
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    Post subject: Re: Extraction of data between date ranges.
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    Post subject:
Reply with quote

Here is what you are looking for.
I modified the rexx from
http://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 Moderator


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

PostPosted: Sat Apr 22, 2006 5:01 am    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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