Posted: Tue Jan 18, 2005 2:08 pm Post subject: Replace Spaces With Current Date
Hi,
I have an Input File which has Some records with Blanks(Spaces) in
the Date Field(CCCCMMYY). The Requirements is that I have to
replace the date Field having spaces with the Current Date.The
records having valid date values should be left untouched and
should remain intact in the output File.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Jan 18, 2005 4:22 pm Post subject:
With z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004), you can do this more easily and efficiently with DFSORT's new IFTHEN and OVERLAY parameters as follows:
Thanks a Lot, but One more problem which forgot to mention was the
there are trailer records which will have the sequence no in the date field
The trailer record are denoted by 9 in the first byte and the detailed record are denoted by 5 in the first byte.I want to replace the
date field having spaces with the Current Date only for the detailed records and remaining records should be intact in o/p file.(The sequence No should appear as it is for the Trailer Record)
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Jan 18, 2005 7:36 pm Post subject:
Dinesh,
I don't know if you didn't see my post or just ignored it, but ...
Looking at your new input data and output data, it appears that you changed the requirements a little bit more than you mentioned. The date now starts in position 5 instead of position 6, and you show 20051801 as the current date which would be in the format yyyyddmm instead of yyyymmdd. Perhaps this was a mistake on your part since it doesn't seem to match the 20050113 date in your input file. And by "single SORT CARD.(Sort pgm)", I assume you mean a single pass over the data.
At any rate, whichever type of date you want, you can do this in a single copy pass with DFSORT as follows:
DATENS=(4DM) produces a 'yyyyddmm' date. If you want a 'yyyymmdd' date, you can use either DATE1 or DATENS=(4MD) instead of DATENS=(4DM). _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Thanks Kolusu & Frank for the Solution. One more query what should be approach if the Input file is in VB Format.The mentioned Jcl worked fine
for FB format File.When I tried for VB format File the Job abended.The Sysout stated like this
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Wed Jan 19, 2005 3:31 pm Post subject:
Dinesh,
Please follow the rules. Post detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.
We will post a detailed solution when you provide us the information
1. What is the LRECL,RECFM of the input/output datasets
2. What is the position of the date field in the file ( consider RDW)
3. Post all the conditions which need to be considered for updating the date.
4. Post a sample input and desired output
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Jan 19, 2005 4:43 pm Post subject:
The WER message indicates you're using Syncsort, so you won't be able to use the IFTHEN/OVERLAY method I posted since IFTHEN/OVERLAY is only available with DFSORT. Also, I don't answer questions on Syncsort. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
I have an Input VB Format File which has detailed records and Trailer Records.The trailer record are denoted by 9 in the first byte and the detailed recordare denoted by 5 in the first byte.
There are Some detailed records with Blanks(Spaces)in the Date Field(YYYYMMDD).
The trailer records will have Some sequence no in the date field
The Requirements is that I have to replace the Detailed records with the date Field having spaces with the Current Date.
The Trailer records ,the Detailed records having valid date values should be left untouched and should remain intact in the output File.
The Input File Length=56, Record Format=VB
Date Field Positon starts from 10th Byte
Can you please let me know about the parameter VLTESTI passed to SORT as I am not very much aware of this. I tried to find it in Google also but seems to have not much info available for this.
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