Posted: Fri Jul 11, 2014 10:31 am Post subject: DFSORT to update Gregorian date from a vsam file
Input fILE
Code:
---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8-
AAaaaa
BBBBBB
cd qqqqqq\qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq1
PUT 'ZZZ.ZZZ.ZZZZZZZZ.ZZZZ.ZZZZ' DDUMMY_@.data
QUIT
I need to update this FTP control card with a Gregorian date from another vsam file which has Julian date in Packed.
---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8-
AAaaaa
BBBBBB
cd qqqqqq\qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq1
PUT 'ZZZ.ZZZ.ZZZZZZZZ.ZZZZ.ZZZZ' DDUMMY_07102014.data
QUIT
I wrote below code, but it looks very complex, is there any easy way to achive this.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Jul 11, 2014 12:04 pm Post subject:
Magesh_J,
What kind of date is 214191? Does the vsam file has just 1 date record?
Btw you don't need Joinkeys to do get the desired results and you are simply wasting resources as you just need a COPY operation instead of SORT operation. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Sat Jul 12, 2014 8:48 pm Post subject:
Magesh_J wrote:
Thanks for the solution, but the date format is 'cyyddd'. Not sure what is the format in dfsort for cyyddd.
Here is the Julian format below and later it is moved to s9(07) comp-3 variable.
Magesh_J,
You could have used the DT1 format which is a 4-byte SMF date value in the form P'cyyddd' (X'0cyydddF') is converted to a Z'yyyymmdd' value. However c = 0 will be transformed to 19 and C = 1 will be transformed to 20 and any thing greater than 1 will be transformed to 21.
In your case you have 2 which would make the date as 2114 instead of 2014. I am not sure as to how you arrived at having 2 as the century.
Anyway here is an untested version of step0100 control cards. I assumed that you always have a CC of 20 for the dates. If you have some other format we have to deal it separately.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Jul 14, 2014 11:58 am Post subject:
Magesh_J wrote:
Hi Kolusu,
Awesome solution !!! worked like a charm...Thank you very much..
Notice that the FINDREP step will NOT run if the VSAM file is empty. So you should have the same code checking on the FTP step too which uses the control cards.
Magesh_J wrote:
But any way, Your soultion will work for another 84 Years and 5 months and 17 days Which is more than sufficient.
Slight correction, It is 85 years 5 Months and 18 days to 2100-01-01 _________________ Kolusu
www.linkedin.com/in/kolusu
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum