Joining input files

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
moumita_majumdar
Member
Posts: 6
Joined: Fri Jan 07, 2011 5:07 pm

Joining input files

Post by moumita_majumdar » Mon Jan 10, 2011 4:31 pm

Hi Frank,

Looking for your advise.

Suppose I have three input files and each have only one field of 8 bytes.
I need to create the output joining the fields.

File1
Data1
Data2
Data3

File2
Data4
Data5
Data6
Data7

File3
Data8
Data9
Data10

The output should be like:
Data1 Data4 Data8
Data2 Data5 Data9
Data3 Data6 Data10
bbbbb Data7

b means space or blank.
How can I join files in such a way through ICETOOL.

Thanks.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Jan 11, 2011 12:16 am

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code: Select all

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/8)
//IN2 DD DSN=...  input file2 (FB/8)
//IN3 DD DSN=...  input file3 (FB/8)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/26)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
COPY FROM(IN3) TO(T1) USING(CTL3)
SPLICE FROM(T1) TO(OUT) ON(27,8,ZD) WITHANY KEEPNODUPS -
  WITH(1,8) WITH(10,8) WITH(19,8) USING(CTL4)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,8,27:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  INREC BUILD=(10:1,8,27:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  INREC BUILD=(19:1,8,27:SEQNUM,8,ZD)
/*
//CTL4CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,26)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

moumita_majumdar
Member
Posts: 6
Joined: Fri Jan 07, 2011 5:07 pm

Thanks

Post by moumita_majumdar » Tue Jan 11, 2011 3:25 pm

Thank you Frank...appreciate your help!!

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others