OPM COBOL Calling ILE Program – Passing Parameters

185 pts.
Tags:
CL Parameters
COBOL
COBOL ILE
ILE Program
I have created two modules. One with the CRTCBLMOD. This is *MODULE type named TESTCBLLE. The other one, using the CRTCMOD, I created *MODULE type named TESTCILE. Then I used the CRTPGM to create the single program TESTING with the *PGM type and the attribute *CBLLE. When I did the CRTPGM command, the first entry was the CBL module and the second was the C module. I then created a regulard OPM COBOL program called COBOLOPM. This simply has a call to the SANDBOX *PGM. This works great, no problem. Here is the part that is not working. I want to pass a parm from the COBOLOPM as WS-FLAG. This is simply a test to pass a parm from the COBOLOPM *PGM to the TESTCBLLE *MODULE. I do not know how to do this. Obviously only *PGM's can be called. But if I call the ILE *PGM TESTING (which contains my COBOL ILE module and my C module), how will it know I am passing a parm to just the COBOL module. All I wanted to do was put in the linkage section, the WS-FLAG1 and move a 'Y' to it. Then i had a display back in my COBOLPGM, after my call, to display the flag. This was just a test to pass the parm. Can I call the COBOL module?
ASKED: October 7, 2010  3:27 PM
UPDATED: October 14, 2010  3:15 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • 400Programmer
    I have a typo above: Written originally: 'This simply has a call to the SANDBOX *PGM.' Should be: 'This simply has a call to the TESTING *PGM.'
    185 pointsBadges:
    report
  • TomLiotta
    Can I call the COBOL module? Yes and no. That is, you don't call "modules" -- you call procedures or programs. A module will include one or more procedures. One or more modules are bound together to create either a program or a 'service program'. Once a program is created, you will call the program. The call will be to the entry procedure. Within the program, you can call any of the other procedures in the same module. You may also call procedures in other modules if they were exported. By not exporting, the procedures remain private to the module. Instead of a program, you might choose to create a service program. A service program is little other than a group of modules collected together. It's usually best if the modules have related purposes. There's not much point in grouping things together otherwise. A service program is a way to use modules over and over without needing to recompile every program that uses them. But your test case is a program, so we'll stick with that for now. You have a program named TESTING. It was built from a module named TESTCBLLE and a module named TESTCILE. You would call it from another COBOL program with CALL 'TESTING' USING WS-FLAG. In the COBOL module, you probably want to call into a procedure in the C module. That will take a little more discussion. The discussion should continue here rather than in a different question in order to keep all related information in one place. If the CALL statement above isn't working correctly for you, let us know. We'll ask questions to locate the problem. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    You have a program named TESTING. It was built from a module named TESTCBLLE and a module named TESTCILE. You would call it from another COBOL program with CALL ‘TESTING’ USING WS-FLAG. Is the CALL statement failing or giving unexpected results? Next steps are fairly easy if you need help. Don't hesitate to have a dialog. Tom
    125,585 pointsBadges:
    report
  • 400Programmer
    I have done the following to make this work: TESTOPM - regular cobol OPM program. This is the top of my calling chain with a working storage. In there I do a CALL TESTCBLLE USING WS-FLAG. So far I have a call from an OPM Cobol Program to a COBOL ILE program (created with CRTBNDCBL). Then I do a call from TESTCBLLE to TESTCILE (c program used with CRTBNDC) as: CALL TESTCILE USING BY REFERENCE RESULT-STRING (just passing text to try). Then I move a 'Y' back to WS-FLAG in TESTCBLLE. All of my displays are in the TESTCBLLE to display: DISPLAY "BEFORE CALLING TESTCILE " RESULT-STRING DISPLAY "CALLING TESTCILE FROM TESTCBLLE" CALL "TESTCLE" USING BY REFERENCE RESULT-STRING. DISPLAY "AFTER CALLING TESTCILE " RESULT-STRING It seems to be working. I went from CBL OPM to CB ILE to C ILE. All three are programs, not modules. I created the ILE's by using the CRTBND. Then back in the top of the food chain program, TESTOPM, after I do my call to the TESTCBLLE program I do: DISPLAY "WAS OPEM TO ILE CBL TO ILE C A SUCCESS?" WS-FLAG.
    185 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following