Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts Extract Data till prev hour balaji81_k DB2 16 Fri Aug 25, 2017 9:25 pm
No new posts FTP data transfer from PC to Mainfram... AJAYREDDY All Other Mainframe Topics 8 Wed Aug 23, 2017 9:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us