DavidatK advised me that I can get faster help in this forum, so here I am.
My requirement is to correct data in a VSAM KSDS file. Its key is:
05 XXX_Account Number PIC 9(19) Comp-3.
05 XXX_Date PIC 9(8) Comp-3.
05 XXX_Time PIC 9(7) Comp-3.
Some of the records in file contains incorrect value for XX_Time. ie, XX_Time(2:2) > 23 or XX_Time >59 or XX_Time(6:2) > 59. So need is to correct the time such that if XX_Time(2:2) > 23, make XX_Time(2:2) = 23, XX_Time > 59 make XX_Time = 59 or XX_Time(6:2) > 59 then make XX_Time(6:2) = 59.
The file contains tens of thousands of records, and quite a few of them have incorrect time value.
So the logic should be:
Read record from input file sequentially,
if time is correct, write same record in output file of same format.
if time is incorrect, correct time and write the record in output.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
In DFSORT terms, your fields are as follows:
05 XXX_Account Number PIC 9(19) Comp-3 -> 10-byte PD field
05 XXX_Date PIC 9(8) Comp-3 -> 5-byte PD field
05 XXX_Time PIC 9(7) Comp-3 -> 4-byte PD field
So your time field starts at position 16 and looks like this: X'0hhmmssC'.
You can use a DFSORT/ICETOOL job like the one below to do what you asked for. I assumed your VSAM records are 19-byte fixed-length records as described. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN and OVERLAY functions. Only DFSORT has these functions, so if you don't have DFSORT, you won't be able to use them. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:
Thanks Frank. My Mainframe has the version of DFSORT you mentioned. But my requirements were not clearly understood by you, Sorry, I havent been that clear. I also tried to understand and change the SYSIN as per my requirement, but wasunsuccessful. Please help again.
The File is VSAM KSDS with record length 425. The key is
Some of the records in file contains incorrect value for FILE11-HIST-TIME. ie, FILE11-HIST-TIME(2:2) > 23 or FILE11-HIST-TIME >59 or FILE11-HIST-TIME (6:2) > 59. So need is to correct the time such that if FILE11-HIST-TIME(2:2) > 23, make FILE11-HIST-TIME(2:2) = 23, FILE11-HIST-TIME > 59 make FILE11-HIST-TIME = 59 or FILE11-HIST-TIME(6:2) > 59 then make FILE11-HIST-TIME(6:2) = 59.
The file contains tens of thousands of records, and quite a few of them have incorrect time value.
So the logic should be:
Read record from input file sequentially,
if time is correct, write same record in output file of same format.
if time is incorrect, correct time and write the record in output.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Vinod,
The job I gave you does what you described in your first post. The only difference I see between what you described the first time and the second time is that you've changed the record layout. The Time field in your new layout starts at position 27 whereas it started in position 16 in the old layout and you've now said that the records are 425 bytes long. Given that, the following variation of my DFSORT job would do what you asked for: