Difference between CRTPGM command and CRTBNDRPG

695 pts.
Tags:
AS/400 Control Language
CL
Create Bound RPG Program
Create Program
CRTBNDRPG
CRTPGM
Hi, Can any one please tell me what is the difference between CRTPGM command and CRTBNDRPG command and what is the appropriate use of these commands ?
ASKED: February 25, 2009  11:41 AM
UPDATED: April 22, 2011  9:51 PM

Answer Wiki

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

CRTRPGMOD – compiles an RPGLE or SQLRPGLE source creating a module
CRTPGM – packages one or more modules into a program

CRTBNDRPG – combines CRTRPGMOD and CRTPGM for simple one module per program cases.
Use this when you can (it is option 14 on PDM).

Phil

///////////////

Hi,
CRTBNDRPG – combines CRTRPGMOD and CRTPGM for simple one module per program cases.
Use this when you can (it is option 14 on PDM).

CRTPGM is used to create an executable program from diverse program modules (modules can be from other programming languages, not just RPG). CRTBNDRPG is used to create a standalone executable RPG program. +

Regards,
Martin Gilbert.

Discuss This Question: 5  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
  • Rjrohwer
    Use CRTPGM if you are compiling a program that uses Modules. Modules are like sub routines but are written out side of the main program. Modules are in a sense a separate program that can accomplish a single task by receiving a piece of information, calculating it and returning a piece of information to the main program. Writing a Module is handy when you have a piece of code that will be needed in several different applications. Instead of having to clog up your main program with a the same piece of code over and over you can write a mod program. The input/output for your mod is coded in the D specs. Think of them as parm's. Here is an example of a written mod that returns a 10 position MM/DD/YYYY date from a Julian Date. H NOMAIN ********************************************************************** *Prototypes ********************************************************************** D #Date10 PR 10 D JulDate 7 0 value ********************************************************************** * (Date10) Return the MM/DD/YYYY value of 7 Digit Julian Date ********************************************************************** P #Date10 B export D #Date10 PI 10 D JulDate 7 0 value D Date10Pos S 10 D Julian5 S 5 0 D MDYDate S D Datfmt(*USA) C Move JulDate Julian5 C *Jul Move Julian5 MDYDate C Move MDYDate Date10Pos C Return Date10Pos P #Date10 E Then in the ILE Program the D Specs and the C Specs to use the mod look like. D #Date10 PR 10 D JulDate 7 0 value ** TermDate is a 7,0 position Julian Date, TUTERM will be the result of the #DATE10 line returning a MM/DD/YYYY value C If TermDate = *Zero C Eval TUTERM = *Blanks C Else C Eval TUTERM = #DATE10(TermDate) C Endif The CRTPGM for compiling the main program with the mod would look something like this. It tells the system what the name of the programs are that to be compiled together as one. If you have a mod in your program but don't list it on the CRTPGM the compile will fail. Program . . . . . . . . . . . . TM010LB Name Library . . . . . . . . . . . TESTLIB Name, *CURLIB Module . . . . . . . . . . . . . TM010LB Name, generic*, *PGM, *ALL Library . . . . . . . . . . . TESTLIB Name, *LIBL, *CURLIB... + for more values M.DATE10 TESTLIB Text 'description' . . . . . . . *ENTMODTXT So the short story is if you are not writing programs with Modulars you should not need to use CRTPGM.
    25 pointsBadges:
    report
  • Cwc
    The use of modules, particularly through service programs, is encouraged because it faciliates code reusability and faster development in the future. Modules can be thought of as basic building blocks for applications. The old model of creating long monolithic programs that are harder to maintain and troubleshoot is obsolete. Smaller components of code which have a specific purpose and use local variables are ultimately easier to to troubleshoot. Once you know that they work, they wouldn't have to be touched again unless their logic or parameter interfaces need to be tweaked, or if you just wanted to know how their logic works. Familiarization with this makes it easier too, to cross over into object oriented programming, such as Java and .Net.
    4,290 pointsBadges:
    report
  • Worktoplay
    One of the best parts of creating a module then binding it into a program allows you to debug the program without the need for source. I support a set of programs used in several locations. Creating the module using *LIST for DBGVIEW and then binding the module into a program, I can debug the program at any location without the need for the source. This is a lifesaver for what I do.
    30 pointsBadges:
    report
  • TomLiotta
    Also note that CRTBNDRPG can bind multiple modules into a *PGM. It just requires the use of BNDDIR() either on the command or in an H-spec in the main module that is being compiled. Tom
    125,585 pointsBadges:
    report
  • pkay101
    write a program that will convert american currencies and return the coverted amount. the program should accept two parameters, the amount and the currency to be converted. this application will allow the user to enter the amount and the currency abbreviation. 
    10 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