I need a file FILE3 to be made out of the above files as below:
Code:
MOVE variable1
TO ws-variable1
MOVE variable2
TO ws-variable2
MOVE variable3
TO ws-variable3
MOVE variable4
TO ws-variable4
MOVE variable5
TO ws-variable5
Assume maximum length of a records in FILE1 and FILE2 is 50. and LRECL of FILE3 is 80.
Can someone help me doing this using DFSORT? Thanks..
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Do 'variable1', 'variable2', ... and 'ws-variable1', 'ws-variable2', ... actually appear in the records as shown? If not, what does the actual data in the records look like?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
If the records in file2 all have the identifier 'Emp-' (or any other identifier) and the records in file1 don't, then you can use a one-pass DFSORT job like this to do what you asked for:
If, however, there really is no way to identify which file a record comes from, then you'd need to use a three-pass DFSORT/ICETOOL job like this to do what you asked for:
The second solution works fine. But I am getting syntax error with the first solution. May be, version installed in my shop, doesnt support IFTHEN statements.
I am pasting the error message here.
Code:
1 SYNCSORT FOR Z/OS 1.1DR TPF3A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYNCSORT INC. DATE=2006/233
z/OS 1.6.0
SYSIN :
INREC IFTHEN=(WHEN=(1,4,CH,NE,C'Emp-'),
*
BUILD=(C'MOVE ',1,9,81:SEQNUM,8,ZD,START=0,INCR=2)),
IFTHEN=(WHEN=NONE,
BUILD=(11:C'TO ',1,12,81:SEQNUM,8,ZD,START=1,INCR=2))
SORT FIELDS=(81,8,ZD,A)
OUTREC FIELDS=(1,80)
WER903I SYNCSORT 1.1 TPF3A IS NOT LICENSED FOR SERIAL 21BF9, TYPE 2064 116, LPAR 2, MSU 441.
WER903I SYNCSORT WILL STOP WORKING IN 30 DAYS UNLESS A VALID KEY IS INSTALLED.
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
The WER messages indicate you're using Syncsort, not DFSORT. Both jobs work fine with DFSORT.
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.