Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
Hi,
I need to extract data from 3 years back going forward to today, but, the field is a 5 byte packed Julian Date.
I found this to get today's date then convert to julian:
then I need to make the first 2 bytes minus 3 years. I saw some INCLUDE date3 (minus days, months) and was curious if date3 has a minus year, and also, if I could just do the minus 3 year within the INCLUDE statement. Thanks.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
madmartinsonxx,
With PTF UK90025 for z/OS DFSORT V1R10 and PTF UK90026 for z/OS DFSORT V1R12(Oct, 2010), DFSORT now supports date arithmetic which can add/subtract days, months or years to a given date like shown below.
For complete details of date arithmetic functions and other new functions see "User Guide for DFSORT PTFs UK90025 and UK90026" paper (sortugph.pdf) at:
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
madmartinsonxx wrote:
well back to the drawing board as we only have through 'G' ICE201I record.
If you don't have the PTF which supports date arithmetic, then use the following DFSORT JCL which will give you the desired results. Subtracting years always results in the same day of the prior year, however if you are subtracting 3 years from a leap year December 31st then you will have invalid Julian date when subtracting 3 years.
ex: December 31st 2012 = 2012 366 (Julian date) - 3 years = 2009 366 which is an invalid date. So we check if the day of the year is 366 and then make the day of the year as 365.
Kolusu,
Many thanks. I added to TOJUL overlay to get the format I need for this project. Going to be symbol table happy for a while now. Hopefully others will get some use of this.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
madmartinsonxx,
Did you realize that you will have asterisks when the date is 2012-12-31 ? I chopped the lrecl to 7 so that you won't see the invalid dates. You expanded the lrecl to 30 and you will see asterisks in position 8 and 20? Is that what you really want?
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
Kolusu,
yes i did realize that the date will be asterisk. I needed the output of the 5 char julian date to get rolling or i would be up the .....I couldn't figure out how to make the TOJUL work after the '366'. Some syntax I was missing i believe, so I stuck that in where it is and i got the field I needed and clapped out loud. I told myself to readdress when I wasn't crunched for time, but, don't we all ! The IFOUTLEN=30 was put in arbitrarily so the outrec could hold my other output. Again, many thanks.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
madmartinsonxx wrote:
Kolusu,
I couldn't figure out how to make the TOJUL work after the '366'. Some syntax I was missing i believe, so I stuck that in where it is and i got the field I needed and clapped out loud.
What exactly do you want your output to look like? Show me the sample desired output and I will show you ways to do it.
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
kolusu,
Sure no problem. The date on the payment history file here is the 5 char julian date type.
Code:
2008028 08028
the second guy there is the one i am stripping out and making a symbol for. the business unit is strict on the 'exact' time frame and they want 3 years back as of the run i make, no matter when I run. Thank you. Go Red Sox !!
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
madmartinsonxx wrote:
kolusu,
Sure no problem. The date on the payment history file here is the 5 char julian date type.
Code:
2008028 08028
the second guy there is the one i am stripping out and making a symbol for. the business unit is strict on the 'exact' time frame and they want 3 years back as of the run i make, no matter when I run. Thank you. Go Red Sox !!
if your sole intention is to make a symbol julian Y2T date , then use the following DFSORT control cards.
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
Kolusu,
yes, that is it. I was going to do this in 2 steps ( due to ignorance right now ) , but, that was exactly what I was trying to achieve. I now have additional tools with which I can generate some additional associations I need for this huge conversion. Having some of the parameter detail you used ingrained in my noggin' is going to be a huge help. I won't bug you guys unless I need to and please.....