Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

JCL to call COBOL program in SYSIN

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
r2k1984

New User


Joined: 21 Jun 2005
Posts: 69
Location: chennai

PostPosted: Wed Nov 28, 2012 10:37 pm    Post subject: JCL to call COBOL program in SYSIN
Reply with quote

All,

Is there a way we can call COBOL program full from JCL SYSIN.

I was trying to do something like this.
Code:
//STEP1    EXEC IGYWCG                                   
//SYSPRINT DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//SYSIN DD *                                             
 IDENTIFICATION DIVISION.                                 
 PROGRAM-ID. ADDPGM.                                     
 ENVIRONMENT DIVISION.                                   
 DATA DIVISION.                                           
 WORKING-STORAGE SECTION.                                 
 77 NUM1        PIC 9(3) VALUE ZEROS.                     
 77 NUM2        PIC 9(3) VALUE ZEROS.                     
 77 RESU        PIC 9(4) VALUE ZEROS.                     
 PROCEDURE DIVISION.                                     
 MAIN-PARA.                                               
        DISPLAY 'ENTER THE NUMBER ONE VALUE'.             
        STOP RUN.                                         


code' d
Please let me know whether it is possible.
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Nov 28, 2012 11:00 pm    Post subject:
Reply with quote

Your terminology is confused. COBOL source is provided to the compiler via the SYSIN DD. The object module produced by the compiler must then be link-edited to be executed; IBM provides compile, compile and link, and compile, link, and go procs; your shop will have its own version of these. "Calling" a module is something entirely different; the compiler never calls a program that it compiles.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Nov 28, 2012 11:10 pm    Post subject: Reply to: JCL to call COBOL program in SYSIN
Reply with quote

You have to look at the JCL which was processed, since you are executing a PROC.

If you are using the standard IBM-supplied proc, you'll need this for your SYSIN:

Code:
//COBOL.SYSIN DD  *


If it is a non-standard but similarly-named PROC, then the stepname for the override may be different.

EDIT. Now that I see it in the Code tags, your program will not compile.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Wed Nov 28, 2012 11:12 pm    Post subject: Reply to: JCL to call COBOL program in SYSIN
Reply with quote

are You referring to what is commonly known as ...
compile link and go ???
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Nov 29, 2012 12:53 am    Post subject:
Reply with quote

Hello,

Quote:
I was trying to do something like this.
Why were you trying to do something like this?

If this had worked, what would you expect for the "output"?

If you explain what you are trying to accomplish, someone may have a suggestion.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Nov 29, 2012 5:10 pm    Post subject:
Reply with quote

I agree with Bill. If you're using IGYWCG procedure, which is a two-step procedure to compile, load, and run a program - you should be using:
Code:
//COBOL.SYSIN DD *


If you've fascination about SYSIN, no step override, you need to use IGYCRCTL and in next step PGM=LOADER:

Code:
//STEP0100 EXEC PGM=IGYCRCTL                   
//SYSPRINT DD SYSOUT=*                         
//SYSTERM  DD SYSOUT=*                         
//SYSUT1   DD UNIT=SYSDA,SPACE=(CYL,(10,2),RLSE)
//SYSUT2   DD UNIT=SYSDA,SPACE=(CYL,(10,2),RLSE)
//SYSUT3   DD UNIT=SYSDA,SPACE=(CYL,(10,2),RLSE)
//SYSUT4   DD UNIT=SYSDA,SPACE=(CYL,(10,2),RLSE)
//SYSUT5   DD UNIT=SYSDA,SPACE=(CYL,(10,2),RLSE)
//SYSUT6   DD UNIT=SYSDA,SPACE=(CYL,(10,2),RLSE)
//SYSUT7   DD UNIT=SYSDA,SPACE=(CYL,(10,2),RLSE)
//SYSLIN   DD DSN=&&LOADSET,                   
//            DISP=(MOD,PASS),                 
//            UNIT=SYSDA,                       
//            SPACE=(CYL,(1,1),RLSE)           
//SYSIN    DD *                                 
        IDENTIFICATION DIVISION.               
        PROGRAM-ID. STRNGTST.                   
        ENVIRONMENT DIVISION.                   
        DATA DIVISION.                         
        WORKING-STORAGE SECTION.               
        01 WS-NAME             PIC X(4).       
        PROCEDURE DIVISION.                                 
             MOVE 'ANUJ' TO WS-NAME.                         
             DISPLAY 'NAME  : ' WS-NAME                     
             GOBACK.                                         
//*                                                         
//STEP0200 EXEC PGM=LOADER,COND=(4,LT,STEP0100),REGION=2048K
//SYSLIB   DD DSN=SYS1.SCEELKED,                             
//            DISP=SHR                                       
//SYSLOUT  DD SYSOUT=*                                       
//SYSLIN   DD DSN=&&LOADSET,DISP=(OLD,DELETE)               
//SYSPRINT DD SYSOUT=*                                       
//CEEDUMP  DD SYSOUT=*                                       
//SYSUDUMP DD SYSOUT=*                                       
//SYSOUT   DD SYSOUT=*                                       
//*                                                         
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Thu Nov 29, 2012 6:34 pm    Post subject:
Reply with quote

The loader runs the object code - 2nd part of compile and go - there is no link. Therefore, if a program has references that must be resolved, it cannot be "compile and goed" (compile and went?).

That having been said, there may have been advances in the 20-ish years since I did a compile and go, in which case i am wrong and someone will (politely) advise.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Nov 29, 2012 7:40 pm    Post subject:
Reply with quote

I believe - it is still the same, the COBOL job step produces an object module that is input to the loader. If the COBOL program refers to any data sets, one must supply the DD statements that define these data sets.

PS.: I hope that's the question?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Nov 30, 2012 3:08 am    Post subject:
Reply with quote

I think that what Mr. Phrzby is thinking of is static linking (I've never tried to execute an object module with dynamic links, so I don't know if that would work or not. Yes, it would be fairly trivial to set up and run a test; I'm just insufficiently motivated to actually do so.)
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Nov 30, 2012 3:57 am    Post subject:
Reply with quote

Quote:
Yes, it would be fairly trivial to set up and run a test; I'm just insufficiently motivated to actually do so.)
Hmmmm . . . . I wonder just how we might institute a "tip jar" icon_cool.gif

d
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Nov 30, 2012 6:33 am    Post subject:
Reply with quote

dick scherrer wrote:
Quote:
Yes, it would be fairly trivial to set up and run a test; I'm just insufficiently motivated to actually do so.)
Hmmmm . . . . I wonder just how we might institute a "tip jar" icon_cool.gif

Well, a few myriads of rupees would work wonders... icon_wink.gif

More seriously, though, I've got enough on my plate at the moment. We've decided not to renew our license with Compuware, and are replacing File-AID with File Mangler -- err, Manager -- and people are just starting to realize that the conversion takes more than changing PGM=FILEAID to PGM=FILEMGR. Likewise, next year our CA license runs out and won't be renewed; only Issuance (promotion from development to test to production) has taken it seriously, everyone else essentially saying, "'Panvawhat'? Do we use that stuff? Well, we'll think about it...in October".
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us