Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8252619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:36:28+00:00 2026-06-08T00:36:28+00:00

Is there any way to specify for a program source, what options for the

  • 0

Is there any way to specify for a program source, what options for the activation group should be used during compilation?

In most of our programs on the as/400 we need to change the handling of the activation group (since the default behaviour is not at all useful…). Everytime I compile one of those programs, I have to remember to set the compiler options (that’s in PDM: enter 14, hit F4, change DFTACTGRP from *YES to *NO, hit enter, change ACTGRP to *NEW or *CALLER, depending on the program). So we have a lot of programs with comments at the beginning, having tons of exclamation marks, reminding the programmer to do so. And yes, sometimes you forget.

Is there any trick, so you don’t have to remember yourself?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:36:29+00:00Added an answer on June 8, 2026 at 12:36 am

    You can set these compiler options in your RPGLE or your CLLE program sources.

    In RPG you would use H-Specs at the top of your source to set compiler options. Like this:

    HDFTACTGRP(*NO) ACTGRP(*CALLER)
    

    Just add it to whatever else you have there, e.g.:

    H DEBUG DATEDIT(*YMD)
    H DFTACTGRP(*NO) ACTGRP(*CALLER)
    H BNDDIR('SRVBNDDIR')
    H MAIN(main)
    F OUTPUT   O    F 3000        DISK    USROPN
    D ...
     * procedures, etc.
    

    In CL, there is a special command DCLPRCOPT which is not actually a command (as it is not executed during runtime), but a way to set compiler options.

    DCLPRCOPT DFTACTGRP(*NO) ACTGRP(*CALLER)
    

    Just put it at the top of your program. I normally put it behind the declaration of variables and before any real command. I also add a short comment, since I don’t think everyone who might right my code might understand what is done there:

    PGM        PARM(&SOMEPARM)
    DCL        VAR(&SOMEPARM) TYPE(*CHAR) LEN(*64)
    DCL        VAR(&COUNTER) TYPE(*DEC) LEN(5 0) 
    
    /* Setting options for compilation of this program */
    /* This is a permanent job, so we want a *NEW activation group. */
    DCLPRCOPT DFTACTGRP(*NO) ACTGRP(*NEW)
    
    /* do actual work here in a loop */
    /* ..... */
    
    ENDPGM
    

    Now, when you compile the program (just enter 14 in PDM and hit enter) it ends up with the activation group behaviour you specified in the source. Nothing left to remember yourself there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to specify that a function should be called when a
Is there a way to specify which namespace includes should be automatically added any
Is there any way to specify table column width as is. In other words,
Is there any way to specify a width when doing :vsplit? Also, is there
Is there any way to specify optional parameters (such as when search parameters are
Is there any way to specify the time intervals that the Location Manager broadcasts
When using JAAS, is there any way to specify the attributes returned by the
Is there any way I can use JPA or hibernate annotations to specify the
Any style for input affects every input element. Is there a way to specify
Is there any way to call method by name and specify arguments without using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.