I want to write a JCL which will make a copy of my variable length dataset with the following changes,
For all records with some specific value at a particular position (say 100 at position starting from 12 ) , the values from position 45 to 50 is to be replaces with XXXXXX
For all the remaining records there should not be any changes .
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Actually, this DFSORT job is a better way to do it then the one shown by Priyesh since with OVERLAY, you just specify the field you want to replace, whereas with BUILD you must specify the fields before and after it as well.
Either way, you'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN function. Only DFSORT has this function, so if you don't have DFSORT, you won't be able to use it. 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:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Nick,
The DFSORT OVERLAY job I showed you will work for VB files. However, if you didn't count the 4-byte RDW in positions 1-4 when you gave the starting positions (12 and 45), then you need to add 4 to each starting position (16 and 49):
Somehow i am getting SYNTAX Error when i use the JCL provided by Frank in his reply.
We have DFSORT installed in our shop ... i wonder what could be reason
this is what i have tried ....
i wanted to replace all the fields starting at position 17 having values 28
to 41 in all the records ....
Can you please help me out in this case ?????
I have a quick Question what if the concerned field is Zoned Decimal will the same JCL Work .....
this is the exact error i am getting somehow i am not able to figure out what`s wrong ....
PRODUCT LICENSED FOR CPU SERIAL NUMBER 1366A, MODEL 2064 1C5 LICEN
SYSIN :
OPTION COPY 0009001
OUTREC IFTHEN=(WHEN=(17,2,CH,EQ,C'28'), 0010001
*
OVERLAY=(17:C'41')) 0011001
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
You can do above changes in JCL with Change command. before using change stmt if the required filed is Packed decimal then need to unpack the packed decimal to numeric value using 'PD'.
Syntax for unpacking data:
OUTREC=(917,7,PD,EDIT=(STTTTTTT.TTTTT),SIGNS=(,-))
Ex: If the input field is PIC S9(7)V9(5) Comp-3. Assume it starts in 917 the position in the Input file. And the mention the length of this Comp-3 filed in next position. Here it is 7 bytes. S: is used for to notify this is Signed Data.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Leo,
As Kevin pointed out, you're using Syncsort, not DFSORT. Your job works fine with DFSORT. But unlike DFSORT, Syncsort does NOT support IFTHEN or OVERLAY so you get an error message.
Quote:
have a quick Question what if the concerned field is Zoned Decimal will the same JCL Work .....
If 17-18 has a ZD value, you could use the following with DFSORT (but obviously not with Syncsort):
Could anybody please help me for the case where the OVERLAY is to be done only after more than one checking. That means I wanted to have more than one condition in a single WHEN statement. Please tell me the syntax for this.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can code DFSORT's WHEN condition with OR and AND operators in the same way you can code the INCLUDE condition with OR and AND operators. MGIndaco has shown the correct syntax using AND which assumes that you want to do the OVERLAY if both conditions are satisfied. If you want to do the OVERLAY if either condition is satisifed, you would use: