You may try this out Use ICETOOL TOOLIN COPY from Rawin to INVDATA using CTL1 COPY FROM RAWIN to FINAL using CTL2 COPY FROM INVDATA TO FINAL USING CTL3 COPY FROM RAWIN TO FINAL USING CTL4 CTL1CNTL OUTFIL FNAMES=INVDATA INCLUDE only I,D,S fields, in BUILD, append a number to indicate priority(the last character in field) something like, 1 to indicate I -> invoice 2 to indicate D -> detail 3 to indicate S -> schedule CTL2CNTL INCLUDE H, M OUTPUT FNAMES=FINAL CTL3CNTL SORT INVDATA ON ACCOUNT_NO, PRIORITY (as appended in first step) OUTFIL FNAMES=FINAL BUILD -> DROP THE LAST CHARACTER CTL4CNTL INCLUDE F OUTFIL FNAMES=FINAL
note: USE DISP=MOD for the FINAL ddname Thanks and Regards Rajeev. Thanks and Regards Rajeev. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html