Cobol Modules and Program

5 pts.
Tags:
AS/400 jobs
COBOL
COBOL/400
PGM
hi,

I have 3 module objects:-

1. Add

2. Update

3. Delete.

I have combined these into 1 module MODA. MODA calls these program on the basis of some condition.

Now my question is:

1. I am not able to create PGM of MODA. the job log says

Definition not found for symbol 'ADD'.

What might be the issue here?

2. Should i make a service program of these three module ADD, DEL and UPD and then bind them into MODA. but in that case i believe we should export the modules. How to export the procedures in Cobol.

Any help would be appreciated.

Thanks,

 



Software/Hardware used:
AS400 COBOL

Answer Wiki

Thanks. We'll let you know when a new response is added.

By making a call to a module from a module, you are required to include those subsequent called modules in any bind you request. This can be done in several ways, depending on what you want/need. You can bind them directly to the program of MODA (MODULE parm on CRTPGM command), or you can include then in a service program and reference the service program in the compile of MODA into a *PGM (BNDSRVPGM parm of the CRTPGM command)

When you use a service program, they are bound to the MODA *PGM by reference, when you bind them into the MODA *PGM directly, they are bound by copy.

As a guideline, I would suggest you bind a module to one-and-only-one object, (*SRVPGM or *PGM). That way, you only have to manage the one version. If it is bound in multiple locations, changes to that module will be more difficult to manage.

Discuss This Question: 3  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
  • TomLiotta
    I have combined these into 1 module MODA. I don't understand. You can't exactly "combine three modules to make one module". You can combine three modules to make one program or one service program. Or you might combine the source that was previously used used to create three modules into a single source to make one module. However, for COBOL, that would normally mean either significant reworking of the source to allow it to compile or possibly changing each source into a COBOL "sub-program" for each "compile unit". For that last part, I only know of one way of doing that. It would result in one of the three sub-programs being available outside of the module as an exported procedure reference. The other two procedures would be internal to the module and not known to other modules. (A variation of that would cause none of the three to be available as external references to other modules.) Please show the source code for MODA. You can delete most of the statements, but you should include all subprogram statements from the top of each one down through each PROGRAM-ID statement. Then lines can be deleted until reaching any END PROGRAM statement in each subprogram, or just show that last couple statements in each. The way that nesting is done of the source in the source member makes a big difference. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    This can be done in several ways, depending on what you want/need. This is certainly true of ILE COBOL. A single CRTCBLMOD command can create many modules at once from a single source member. (The number is probably limited by how many source statements can fit in a single member divided by the minimum number of source statements that can result in one compiled module.) Or the same CRTCBLMOD command might create only a single module from that source member if the source is rearranged just a little, perhaps by moving just one source line -- an END PROGRAM statement. Tom
    125,585 pointsBadges:
    report
  • Gta
    [...] Cobol Modules and Program [...]
    0 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