Cameron:

I can't help you with your COBOL (not one of my languages), but what you need is some JCL help. Retired Mainframer set you on the the right direction by saying you should look for another procedure. As he said, language (assembler and compiler) procedures usually come in three forms: xxxC (compile only), xxxCL (compile and link/load) and xxxCLG (compile, load and go). You used IGYWCLG . There is an IGYWCL procedure on the Marist system, which you can use to to do what you want.

One thing you will have to do is find or set up a load library where you can link the load module you are creating. You can model the load library after the SYSLMOD DD statement in the LKED step in the procedure. SYSLMOD is where the LINK step puts the load module it creates. So you want to override this statement, creating a permanent library of your own or using a library of your own that already exists. If you don't have such a library already, I'd suggest:

//LKED.SYSLMOD DD DSN=KC02117.MY.LOADLIB,DISP=(,CATLG),UNIT=SYSALLDA,
//    SPACE=(CYL,(1,1,5)),DSNTYPE=LIBRARY         MAKE THIS A PDS/E

This needs to go after the end of your COBOL source code in order for it to be seen as being a part of the LKED step (hence LKED.SYSLMOD).

Creating the library as above does not name the member program, so you need to tell the link step what you want to call it. In the LKED step you will also see the //SYSLIN DD statement which concatenates the output of the COBOL compiler with an optional set of control statements for the link step. These statements, if supplied, would follow a //SYSIN DD statement, if supplied, so you want one after the SYSLMOD statement above. It should look like:

//LKED.SYSIN DD *
NAME PROG1(R) - this supplies the member name for your program and can be anything, but it will have to match what you put on the EXEC statement for your "GO" step, which you will need to create and is described below. The (R) option causes the program to be replaced if you have to run the job again.

Last, you have to create a replacement for the GO step which is not a part of the procedure you had used. BTW, the //GO.ddname items as defined in your existing JCL will result in JCL errors, so you have to change all //GO.ddname DD statements to //ddname DD statements (remove the GO. part).

I would recommend you model your new "GO" step after the JCL in the IGYWCLG procedure. Keep the EXEC statement, but change it to EXEC PGM=PROG1 (or whatever you choose to use in the NAME statement for the LINK step).

You should keep the //STEPLIB DD statement in the CLG procedure, but you will want to concatenate your load library created above to it, so follow up the existing STEPLIB DD statement with:

// DD DSN=KC02117.MY.LOADLIB,DISP=SHR - make sure this matches the name in the SYSLMOD statement above

Now follow up the STEPLIB concatenation with the remainder of your JCL originally intended for your GO step, but remember to remove the GO. parts of these DD names.

This should do it for you. There are other ways you could handle this, but I thought this was the easient fo explain and hope it will beef up your understanding of JCL. Good luck.

Mike Myers
Mentor Services Corporation


On 11/04/2013 09:49 PM, Cameron Seay wrote:
All:

I am a re-newbie to COBOL (learned it years ago but it's very rusty). I am 
teaching it to my students because it's a great job skill now.  Below is job 
that contains the source code inline and runs great.  It compiles, links and 
runs error free.  What I want is the syntax to place the LOAD module into a 
data set.  I tried what I thought would work, but it didn't.  Many thanks!

//KC02177B JOB (12345678),'V HAMPTON',MSGLEVEL=(1,1),REGION=0M,
// NOTIFY=&SYSUID,MSGCLASS=A,CLASS=A
//****
//COBOL1  EXEC IGYWCLG,
//  PARM.COBOL='TEST,RENT,APOST,OBJECT,NODYNAM,LIB,SIZE(5048376)'
//COBOL.SYSPRINT DD SYSOUT=*
//COBOL.SYSIN DD *
        IDENTIFICATION DIVISION.                                         
00000004
        PROGRAM-ID.  PROG1.                                              
00000006
        AUTHOR. VICKI HAMPTON.
       *  LAB EXERCISE 1.                                                
00000007
        ENVIRONMENT DIVISION.                                            
00000009
        CONFIGURATION SECTION.                                           
00000011
        INPUT-OUTPUT SECTION.                                            
00000017
        FILE-CONTROL.                                                    
00000019
             SELECT INPUT-FILE   ASSIGN TO DA-S-INPUT.                   
00000021
             SELECT PRNT-FILE    ASSIGN TO UR-S-PRNT.                    
00000024
       *   INPUT-FILE IS THE NAME THE PROGRAM WILL USE
       *    DA-S-INPUT TELLS JCL TO ASSIGN THE INPUT DATA
       *    TO THE FILE NAME INPUT-FILE, SAME FOR PRNT-FILE
       *    AND UR-S-PRNT
        EJECT                                                            
00000025
       *   EJECT DIRECTS THE PRINTER TO START THE NEXT
       *   OUTPUT TO BEGIN AT THE TOP OF THE PAGE
        DATA DIVISION.                                                   
00000026
            SKIP3                                                        
00000027
       *       SKIP 3 INSERTS 3 BLANK LINES
        FILE SECTION.                                                    
00000028
            SKIP2                                                        
00000029
       *        SKIP TO INSERTS 2 BLANK LINES
        FD  INPUT-FILE                                                   
00000030
            BLOCK CONTAINS 0 RECORDS                                     
00000031
       *      THIS INFORMS THE SYSTEM THAT NO RECORDS ARE PRESENT
       *      WHEN WE START (WE ARE READING OUR DATA FROM
       *      AN INLINE STREAM
            LABEL RECORDS ARE STANDARD.                                  
00000032
        01  INPUT-REC                 PIC X(80).                         0000033
            SKIP2                                                        
00000034
        FD  PRNT-FILE                                                    
00000045
            LABEL RECORDS ARE OMITTED.                                   
00000046
        01  PRNT-REC.                                                    
00000047
            03   PIC X(60).
            03   PIC X(65).
       *  THIS IS FORMATTING FOR OUR REPORT
            SKIP2                                                        
00000048
            EJECT                                                        
00000049
        WORKING-STORAGE SECTION.                                         
00000050
            SKIP2                                                        
00000051
       **************************************************************    
00000052
       *           LAYOUT FOR THE INPUT FILE                       *    00000053
       **************************************************************    
00000054
        01  INPUT-DATA.                                                  
00000055
            03  I-NAME                 PIC X(20).                        
00000057
            03  DEPT                   PIC X(10).
            03  FILLER                 PIC X(50).                        
00000058
       *  FILLER IS USED FOR PADDING
            SKIP2                                                        
00000062
            EJECT                                                        
00000096
       **************************************************************    
00000097
       *      LAYOUT FOR THE 1ST  DATA LINE OF REPORT PRNTING       *    
00000098
       **************************************************************    
00000099
        01  PRNT-DATA1.                                                  
00000100
            03  FILLER                 PIC X(10)      VALUE SPACES.      
00000101
            03  L-NAME1                PIC X(20).                        
00000104
            03  FILLER                 PIC X(10)      VALUE SPACES.
            03  DEPT1                  PIC X(10).
            03  EXTRA                  PIC X(50).
            03  EXTRA2                 PIC X(40)
               VALUE 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'.
            03  EXTRA3                 PIC X(5) VALUE 'EEEEE'.
            SKIP2                                                        
00000105
       **************************************************************    
00000129
       *    LAYOUT FOR THE 1ST HEADING LINE OF REPORT PRNTING       *    
00000130
       **************************************************************    
00000131
        01  PRNT-HEADING1.                                               
00000132
            03  FILLER                 PIC X(10)      VALUE SPACES.      
00000133
            03  FILLER                 PIC X(20)      VALUE 'NAME'.      
00000136
            03  FILLER                 PIC X(10)      VALUE SPACES.
            03  FILLER                 PIC X(10)      VALUE 'DEPT'.
            SKIP2                                                        
00000137
       **************************************************************    
00000155
       *                 MISCELLANEOUS DATA NAMES                   *    
00000156
       **************************************************************    
00000157
        01  MISC.                                                        
00000158
            SKIP2                                                        
00000159
       **************************************************************    
00000160
       *                 END OF FILE (EOF) SWITCHES                 *    
00000161
       *            0 = NOT AT EOF          1 = AT EOF              *    
00000162
       **************************************************************    
00000163
            03  EOF-I                  PIC 9         VALUE 0.            
00000164
       **************************************************************    
00000201
       *               START OF PROCEDURE DIVISION                  *    
00000202
       **************************************************************    
00000203
        PROCEDURE DIVISION.                                              
00000204
        000-MAINLINE.                                                    
00000206
            OPEN INPUT INPUT-FILE                                        
00000207
                 OUTPUT PRNT-FILE.                                       
00000210
            PERFORM 2000-READ-INPUT.                                     
00000211
            PERFORM 1400-PRINT-HEAD.
            PERFORM 1500-LOOP                                            
00000217
                    UNTIL EOF-I = 1.                                     
00000218
            CLOSE INPUT-FILE                                             0000219
                  PRNT-FILE.                                             
00000221
            STOP RUN.                                                    
00000223
        1400-PRINT-HEAD.
            WRITE PRNT-REC FROM PRNT-HEADING1                            
00000265
                  AFTER ADVANCING PAGE.                                  
00000266
            MOVE SPACES TO PRNT-REC.                                     
00000267
            WRITE PRNT-REC                                               
00000268
                  AFTER ADVANCING 1 LINE.                                
00000269
        1500-LOOP.                                                       
00000248
            PERFORM 1600-PRINT-NAMES.                                    
00000255
            PERFORM 2000-READ-INPUT.                                     0000249
       **************************************************************    
00000261
       *   PRINTS THE SCHEDULE INFORMATION                          *    
00000262
       **************************************************************    
00000263
        1600-PRINT-NAMES.                                                
00000264
            MOVE I-NAME                     TO  L-NAME1.                 
00000271
            MOVE DEPT                       TO  DEPT1.
            WRITE PRNT-REC FROM PRNT-DATA1                               
00000272
                  AFTER ADVANCING 1 LINE.                                
00000273
       **************************************************************    
00000324
       *                READS THE INPUT FILE                       *     0000325
       **************************************************************    
00000326
        2000-READ-INPUT.                                                 0000327
            READ INPUT-FILE INTO INPUT-DATA                              000328
                 AT END MOVE 1 TO EOF-I.                                 
00000329
//GO.SYSOUT DD SYSOUT=*
//GO.SYSPRINT DD SYSOUT=*
//GO.INPUT DD *
VICKI HAMPTON       CIS
GEORGE WASHINGTON   ENG
IVAN ISGREAT        PHY
IGOR ISBETTER
IVANA GOHOME
COB OL
HUGH LESS
GARY MORE
PAULA PANTHER
//GO.PRNT DD SYSOUT=*


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to