CRTSQLRPGI

190 pts.
Tags:
AS/400
AS400 RPGLE
SQL statements
I have two questions about an RPGLE program with embedded SQL statements:

When compiling an RPGLE program with embedded SQL statements, how do you set the activation group?

I am trying to run a program which ran when we were on version 5V4. Now that I am on version 6.1, the exact same program will not run. Is there something different I have to do when compiling? My commitment control is set to *NONE.



Software/Hardware used:
AS400 V6.1

Answer Wiki

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

Since the CRTSQLRPGI command does not have this parameter, your best bet is to imbed the instructions in your RPGLE source code as a header directive. Certain compile parameters cann be added to an H-spec line to force these parameters to be used everytime you compile the program. Try putting the following H-spec in your program.
<pre>
H DftActGrp(*No) ActGrp(‘activation group’)
</pre>
where the ActGrp is the name of the activation group you want to start this program in.

There are many other compile options you can select from. When you prompt on the Keywords entry field with an F1, this will take you to all of the H-spec directives you can use. The nice thing about these is you never have to wory that the next progammer will compile with the wrong parameters as what is in the source overrides any other in the create command.

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
  • Splat
    What errors show in the job log (or program dump) when you try to run the program?
    7,425 pointsBadges:
    report
  • TomLiotta
    When compiling an RPGLE program with embedded SQL statements, how do you set the activation group? WaltZ400's answer is the best choice, but it's not always possible. If you can't place the directives in the source, you can use the CRTSQLRPGI COMPILEOPT() parameter:
    COMPILEOPT('DftActGrp(*No) ActGrp(myactgrp)')
    That parameter is used by the SQL precompiler to pass parms into the RPG compile. Now that I am on version 6.1, the exact same program will not run. Is there something different I have to do when compiling? Probably. But unless you tell us something about what happens, we have no way of guessing what should be done differently. Tom
    125,585 pointsBadges:
    report
  • Peg

    Since we migrated to OS 7.1, if you compile program CRTSQLRPGI that has a OVRDBF using QCMDEXC on the SQL declare cursor file, it does not recognize the file over ride.  It does not error, just will not take the over ride.  Is this happening for others and how do we resolve this?  

    10 pointsBadges:
    report
  • TomLiotta
    Is this happening for others and how do we resolve this?
    .
    It should only happen if the OVRDBF isn't appropriate for the compile options of the program. If we can't see the OVRDBF and the compile options, we can't know what's being done wrong.
    .
    Also, we might need to know the migration path. What was the previous version? Was it a migration or an OS upgrade? Was the OVRDBF command defaults changed in the previous system image?
    .
    Tom
    125,585 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