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:
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):
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
OPTION COPY 0009001
OUTREC IFTHEN=(WHEN=(17,2,CH,EQ,C'28'), 0010001
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:
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.
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.
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: