How to use GPO EXTRACT with NOINC to copy all members of a Librarian master file to a PDS without expanding the -INC statements in the source.

Document ID : KB000051682
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

How to use -GPO -EXTRACT with the NOINC parm so as to not expand -INC statements

Solution:

-GPO -EXTRACT command does not allow the use of parm NOINC which causes EXTRACT to not expand the -INC statements in the source.
-EXTRACT can only use the NOINC parm when it follows a -OPT UTILITY, not when it follows a -GPO command.

Here is a way to use NOINC. A -GPO EXTRACT is used to create a sequential file of -EXTRACT commands and then a REXX is executed to update that file with the NOINC parm. A ./ ADD NAME= command is also used so that the file can be input to IEBUPDTE to create a PDS.

Here is the REXX program you will need to copy to your SYSPROC dataset:

 /* REXX EXEC TO ADD NOINC PARM   */
 
     RECSI. = ''
     RECSO. = ''
     I = 1
     O = 1
     "EXECIO * DISKR DDIN (STEM RECSI.)"
     DO UNTIL I > RECSI.0
        IF RECSI.I = './ ADD NAME='
           THEN DO
                J = I + 1
                PARSE VAR RECSI.J EXTRLIT REST
                IF EXTRLIT = '-EXTRACT'
                   THEN DO
                        PARSE VAR RECSI.J 10 LONGNAME 19
                        PARSE VAR LONGNAME MBRNAME ',' REST
                        O = I
                        RECSO.O = './ ADD NAME=' || MBRNAME
                        O = O + 1
                        PARSE VAR RECSI.J LIT1 LIT2 REST2
                        RECSO.O = LIT1 || ' ' || LIT2 || ',NOINC'
                        O = O + 1
                        I = I + 2
                        END
                   ELSE I = I + 1
                END
           ELSE DO
                RECSO.O = RECSI.I
                O = O + 1
                I = I + 1
                END
     END
     ADDRESS MVS 'EXECIO * DISKW DDOUT (STEM RECSO. FINIS)'

Sample JCL to run the 4 step process is attached. You must update the appropriate dataset names and specify appropriate file sizes based on the size of your master file.

File Attachments:
TEC522244.zip