IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL to call COBOL program in SYSIN


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1788
Location: Bloomington, IL

PostPosted: Wed Nov 28, 2012 11:00 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Nov 28, 2012 11:10 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 28, 2012 11:12 pm
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

Moderator Emeritus


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

PostPosted: Thu Nov 29, 2012 12:53 am
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

Superior Member


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

PostPosted: Thu Nov 29, 2012 5:10 pm
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

Senior Member


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

PostPosted: Thu Nov 29, 2012 6:34 pm
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

Superior Member


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

PostPosted: Thu Nov 29, 2012 7:40 pm
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: 1788
Location: Bloomington, IL

PostPosted: Fri Nov 30, 2012 3:08 am
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

Moderator Emeritus


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

PostPosted: Fri Nov 30, 2012 3:57 am
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: 1788
Location: Bloomington, IL

PostPosted: Fri Nov 30, 2012 6:33 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top