Page 1 of 1

Mainframe SYSLIB

PostPosted: Tue Apr 05, 2016 12:33 pm
by CobDummy
Hi,

I am new in mainframe, could someone please guide me.

- once I compile a cobol program it will be created in some syslib, that I need to mention in JCL while submitting the job, how to find the syslib path where the programs are being created.

- trying to use copy in cobol program but its giving error, member not found in copy library, I am not sure which one is copy library..

thanks in advance..

Re: Mainframe SYSLIB

PostPosted: Tue Apr 05, 2016 1:03 pm
by enrico-sorichetti
in IT using the right terminology is very important

syslib is NOT a general use term in IBM terminology.

in general when compiling a program a few datasets/libraries are involved
let' s forget about the sysouts

compile step
- the source program, usually a member in a partitioned dataset
- the library where the copybooks/includes/macros are found
- compiler ouput

linkage editor step
- compiler output as input
- the library where the load module will be stored
- the libraries where external <subroutines> are found
- the linkage editor control statements

SYSLIB is the ddname used for the dataset's concatenation containing the copybooks/includes/macros

at the end to find out the names of the datasets to be used
the best place to ask is Your support or colleagues

Re: Mainframe SYSLIB

PostPosted: Tue Apr 05, 2016 1:13 pm
by Aki88
Hello,

Please share your compilation JCL.
From the info you've shared -

CobDummy wrote:- once I compile a cobol program it will be created in some syslib, that I need to mention in JCL while submitting the job, how to find the syslib path where the programs are being created.


Are you looking for the merged source of the COBOL program or the load module generated, post completion of IGYCRCTL execution?
Either way, have a look here first, to understand a user-defined IGYCRCTL JCL construct, and the DD statements required for it.

SYSLIB in an IGYCRCTL JCL is used to provide COPY-book libraries for compilation; which brings us to the second part of your question:
CobDummy wrote:- trying to use copy in cobol program but its giving error, member not found in copy library, I am not sure which one is copy library..


From what you state, it means that the COPY statement copybook (mentioned by you in the COBOL program) is not present in any of the PDS/E given in your SYSLIB DD concatenation.
Concatenate the correct PDS/E (which has the said COPY member present in it) to the SYSLIB; and try running your compilation JCL again.

Hth.

<Edit: Sorry Enrico, didn't see you'd already posted the reply>

Re: Mainframe SYSLIB

PostPosted: Tue Apr 05, 2016 5:43 pm
by CobDummy
Hi..

I am getting this compilation error in with COBOL program..
IGYLI0048-S   The member "EMPCPY" was not found in the "COPY" library.


so this error is not related to JCL code (right?)

I don't have any support team, trying to learn by myself..

COBOL Program Code

 IDENTIFICATION DIVISION.        
 PROGRAM-ID. EMPINDX2.          
 ENVIRONMENT DIVISION.          
 INPUT-OUTPUT SECTION.          
 FILE-CONTROL.                  
     COPY EMPCPY.                
 DATA DIVISION.                  
 FILE SECTION.                  
 FD  EMP-INDEX                  
     LABEL RECORDS ARE STANDARD.
 01  EMP-RECORD.                
     05 EMP-ID         PIC X(5).
     05 EMP-FNAME      PIC X(10).
     05 EMP-LNAME      PIC X(10).
                                 
 WORKING-STORAGE SECTION.        
 01  WS-STATUS  PIC X(2).        
 01  EOF        PIC X(1).        
                                 
 PROCEDURE DIVISION.            
 PROGRAM-BEGIN.                  
                                 
     OPEN I-O EMP-INDEX.        
                                 
 PROCEDURE DIVISION.                            
 PROGRAM-BEGIN.                                  
                                                 
     OPEN I-O EMP-INDEX.                        
                                                 
     MOVE "N" TO EOF.                            
     PERFORM  READ-EMP.                          
     PERFORM  DISPLAY-EMP                        
              UNTIL EOF = "Y".                  
                                                 
     CLOSE    EMP-INDEX.                        
                                                 
 PROGRAM-DONE.                                  
     STOP RUN.                                  
                                                 
 READ-EMP.                                      
     READ EMP-INDEX NEXT RECORD                  
     AT END MOVE "Y" TO EOF.                    
*    DISPLAY WS-STATUS.                          
                                                 
 DISPLAY-EMP.                                    
     DISPLAY EMP-ID " " EMP-FNAME " "  EMP-LNAME.
     PERFORM  READ-EMP.                          
 

Re: Mainframe SYSLIB

PostPosted: Tue Apr 05, 2016 5:51 pm
by enrico-sorichetti
the last post adds nothing to the info already provided.

where did You store the EMPCPY thing ?

Re: Mainframe SYSLIB

PostPosted: Tue Apr 05, 2016 5:55 pm
by CobDummy
Placed in same PDS where the COBOL code is, actually that is my doubt.. where to place it.. :(

Re: Mainframe SYSLIB

PostPosted: Tue Apr 05, 2016 6:28 pm
by Aki88
Hello,

CobDummy wrote:Placed in same PDS where the COBOL code is, actually that is my doubt.. where to place it.. :(


Hope you'd read the earlier posts prior posting the COBOL code:

Aki88 wrote:Please share your compilation JCL.


enrico-sorichetti wrote:SYSLIB is the ddname used for the dataset's concatenation containing the copybooks/includes/macros


After which it also gave a link to the IBM manuals, which explains the compilation JCL, step by step, DD statement to DD statement.
Before you look any further, you really need to understand how a simple compilation JCL is written.
Once you have understood that, try adding your PDS - which has the 'EMPCPY' member - to the SYSLIB DD concatenation; submit the JCL, and check what happens.

Once again - revisit your compilation JCL; before you actually fix your code, you need to check if you have 'all the pre-requisites' in your compilation JCL; which can be PDS/E containing your copybooks, or SYSIN PDS/E containing your valid COBOL source, or a valid STEPLIB PDS/E; and so on, so forth. Also, do read and understand Enrico's earlier post, which explains various compilation checkpoints.

Hth.

Re: Mainframe SYSLIB

PostPosted: Tue Apr 05, 2016 8:09 pm
by enrico-sorichetti
if You can tell which system You are working on
we might give better suggestions

what about reading the cobol manuals!