Skip to main content

Problem:

We have the following host JCL:

//**********************************************************                    

//ZIPSTP2 EXEC PGM=PKZIP,REGION=32M,TIME=1440                                   

//STEPLIB  DD DISP=SHR,DSN=PKZIP.LOADLIB                                        

//SYSPRINT DD SYSOUT=*                                                          

//SYSUDUMP DD SYSOUT=*                                                          

//GDG0001  DD DSN=AUCP0.DAI.LABIT50.OUT2(0),DISP=SHR                            

//SYSIN    DD *                                                                 

-ECHO                                                                           

-METHOD(MAXIMUM)                                                                

-DATA_TYPE(TEXT)                                                                

-FILE_TERMINATOR( )                                                            

-ARCHIVE(AUCP0.DAI.LABIT50.OUT2.ZIP)                                            

-NIA(*,APIMP1.DAT)                                                     

-INFILE(GDG0001)                                                                

//**********************************************************     

Is there a means to emulate this in MFE?

Resolution:

Yes, but since this is a utility we are trying to CALL, it is not straightforward.

Here is a sample program that can be run from a Mainframe Express Command Prompt to CALL PKZIP / PKUNZIP (or Notepad or some other utility). It could be called from JCL and then have it call PKZIP / PKUNZIP passing it the parameters it expects. Or one could use a batch file to do this.

The obstacle in this are the control cards - they specify the MVS DSN which of course PKZIP etc will not understand so you have to obtain the real PC filenames from the Mainframe Express Catalog.

       Identification Division.

       Program-Id.  LORINCE.

       Environment Division.

       Data Division.

       Working-Storage Section.

       1   wcmd-path         Pic X(40) Value Spaces.

       1   command-line-len  Pic X(4) Comp-5 Value 40.

       1   run-unit-id       Pic X(8) Comp-5 Value Zero.

       1   stack-size        Pic X(4) Comp-5 Value Zero.

       1   flags             Pic X(4) Ccomp-5 Value Zero.

       1   tty-cmd           Pic X(8) Value Spaces.

       1   tty-cmd-len       Pic X(4) Comp-5 Value Zero.

       1   status-code       Pic X(2) COMP-5 Value Zero.

       Procedure Division.

       P1.

           Accept wcmd-path From Command-Line

           Display 'Parm:' wcmd-path

           Perform P2.

           Stop Run.

       P2.

           Call 'CBL_EXEC_RUN_UNIT' using wcmd-path

                       by value     command-line-len

                       by reference run-unit-id

                       by value     stack-size

                                    flags

                       by reference tty-cmd

                       by value     tty-cmd-len

                       returning    status-code

           End-Call

           If status-code = Zero

              Display 'Good Status Code:' status-code

            Else

              Display 'Bad Status Code:' status-code

           End-If

       End Program NEW9135.

Old KB# 2512

#MFDS
#EnterpriseDeveloper