Thursday, December 8, 2011

How to ZIP files in mainframe

There is a utility called PKZIP in mainframe and it can be used to ZIP sequential files, VSAM files, PDS, PDSE members. Sample job is given below.

//STEP01 EXEC PGM=PKZIP
//SYSPRINT  DD SYSOUT=*
//RTFILE DD DISP=SHR,DSN= input file to be zipped
//ZIPFIL DD DISP=...zip file name
//       DISP=(NEW,CATLG,DELETE)
//      SPACE=(CYL,(5,5),RLSE)
//SYSIN DD *
-ECHO
-INFILE(RTFILE)
-ARCHIVE_OUTFILE(ZIPFILE)
-ACTION(ADD)
//*

The Zipped file will be in ASCII mode. So if you want to transfer the zipped file to your PC, then you should transfer it in "binary" mode.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.