how to copy multiple vsam files into a single flat file

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
Priya Pandiyan
Member
Posts: 2
Joined: Mon Dec 31, 2012 6:20 pm

how to copy multiple vsam files into a single flat file

Post by Priya Pandiyan » Mon Dec 31, 2012 6:38 pm

Hi, I am trying to copy the contents of 5 different VSAM files into a single flat file.. can you please let me know whether the SORT or ICETOOL utilities help this situation? I was successful in copying single VSAM file but not with the multiple VSAM files. Thanks in advance.

MrSpock
Active Member
Posts: 273
Joined: Wed Jun 27, 2007 5:37 pm

Post by MrSpock » Mon Dec 31, 2012 6:51 pm

A single ICETOOL step with five COPY statements correlating to five input DD statements should work for you.

Priya Pandiyan
Member
Posts: 2
Joined: Mon Dec 31, 2012 6:20 pm

Post by Priya Pandiyan » Mon Dec 31, 2012 7:43 pm

Thanks for the reply.. I just started copying 2 VSAM files as below - but just the contents of the second VSAM file (VSAMFILE2) is copied to the OUT dataset. It appears to me that the second COPY has overrided the first COPY.

Please let me know if I am missing something.

//TOOL EXEC PGM=ICETOOL
//IN1 DD DSN=VSAMFILE1,
// DISP=(SHR,KEEP,KEEP)
//IN2 DD DSN=VSAMFILE2,
// DISP=(SHR,KEEP,KEEP)
//OUT DD DSN=DATX00D.CMBN.BF1231G,
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=327)
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(OUT) VSAMTYPE(F)
COPY FROM(IN2) TO(OUT) VSAMTYPE(F)

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Mon Dec 31, 2012 9:45 pm

Check out what DISP=MOD means.

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