I have two fixed block input files .
FILE 1 = FB 40 byte
FILE 2 = FB 24 byte
output file
FILE3 = FB 24 byte
Here are the rules
1) if File 1 is empty no processing . Simple copy FILE2 to FILE3
2) if File 1 field starting from 7 column(Length 2 BYTE) is equal to FILE 2 FIELD STARTING FROM 23 BYTE(LENGTH 2 BYTE) .Then File 2 (23rd to 25 th byte should be replaced with File 1 (10 to 11 byte) and written to a new output file(file3) same attribute as of file 2
3) IF other case record from file 2 should be written to (file3)
here is the example
FILE 1
Code:
=COLS> ----+----1----+----2----+----3----+----4
****** ***************************** Top of Dat
000001 111111XXYY
000001 111111ZZAA
****** **************************** Bottom of D
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
shr_amar,
Here's a DFSORT JOINKEYS job that will do what I think you're asking for. You'll need the Nov, 2009 PTF to use JOINKEYS. If you don't have that PTF, ask your System Programmer to install it.
I m not sure whether Nov, 2009 PTF to use JOINKEYS is present in my shop. i will check . But do we have any other way .Secondly the code which you have given me will work if FILE 1 is empty.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
First, check to see if you have the Nov, 2009 PTF. If not, we can discuss the possibility of another way (I'd have to spend time thinking about it and I'd rather not if you can use JOINKEYS).
The DFSORT job will copy all of the records in input file2 to the output file if input file1 is empty.
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 09:34
JOINKEYS F1=IN1,FIELDS=(7,2,A)
£
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
JOINKEYS F2=IN2,FIELDS=(23,2,A)
£
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
JOIN UNPAIRED,F2
£
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
REFORMAT FIELDS=(F2:1,24,F1:9,2,?)
£
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
SORT FIELDS=(1,8,CH,A)
£
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
OUTFIL IFOUTLEN=24,
£
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
IFTHEN=(WHEN=(27,1,CH,EQ,C'B'),
IFTHEN=(WHEN=(27,1,CH,EQ,C'B'),
£
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
OVERLAY=(23:25,2))
£
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT
ICE751I 0 C5-K48846 C6-K90014 E7-K48846
ICE052I 3 END OF DFSORT
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
shr_amar,
If you go back to the job I posted, you'll see that I have blanks at the start of each line in //SYSIN. You don't. That's what the message
BLANK NEEDED IN COLUMN 1 is telling you.
However, C6-K90014 tells me that you don't have the Nov, 2009 PTF so you can't use JOINKEYS. Ask your System Programmer to install that PTF (it's free). For more information on the PTF, see: