Marc's Place


E$EXP - Expand and Compile Source Member

e$exp [F4]

Call Parameters

srcmbr (a10)
Source file member name to expand.
srcfil (a10/a10)
Source file name and Library name where member srcmbr can be found.
comp (a4)
Value: *YES [default]
Prompt for compilation when source member is expanded.
Value: *NO
Do not prompt for compilation.
objlib (a10) [only with COMP(*YES)]
Library where the compiled object should be placed.
Value: ' ' [default]
The default value is a single space. You can permanently change this value to something else with the CHGCMDDFT command. Better still, create an option in PDM instead of changing this parameter.

Return Parameters


What it does

The processing program reads the source file and searches for /COPY or $COPY keywords. When found, the program creates a copy the source file in a new source file. This source file is named as follows:

'E$XP' + <source member type>

and is created in the library you So the source file for expanded sources would be:

'E$XPRPG'      Source file for expanded RPG sources
'E$XPPF'       Source file for expanded PF sources
'E$XPQRYDFN'   Source file for expanded QRYDFN sources

If you need to recompile programs, do not forget to use the expanded source instead of the original! You can also ALWAYS use E$EXP to recompile programs.

To include source lines, specify the $COPY keyword in a comment line ith the following syntax:

$COPY <library>/<source file>,<member>

You can put $COPY anywhere in the comment line. So, here are some examples of how to specify the $COPY statement in the major source types:

  • In RPG
    /COPY <library>/<source file>,<member> or
    *  $COPY <library>/<source file>,<member>
  • In CLP
    /*  $COPY <library>/<source file>,<member>   */
  • In DDS
    A*  $COPY <library>/<source file>,<member>

Special Options

RPG Source Members
For RPG source members E$EXP acts as CRTRPTPGM. That means you can code all the RPG Specifications you need (F-specs, E-specs, I-specs, etc.) in one source member and include that member in your RPG program using $COPY.
E$EXP takes care of the correct placement of these RPG Specifications in the expanded source member.
DSPF Source Members
If you code $COPY by hand, make sure you code it directly above an existing record format specification. Otherwise you will lose your comment line when you use SDA to edit the display file. Placing the $COPY keyword above a record format specification is like using option 2 in SDA: Edit Record Format Comments.
With SDA, use option 2 to edit a comment line and insert the $COPY statement.


Here's a member which has standard coding for a SFLMSG in DSPF sources in QDSPSRC:

This member is then included in all Display Files like this:

And here is the expanded result:

Go to download page
© 1997- Marc Vos (and others)   -   Privacy Statement   -    Contact Me

On this website, Google Analytics is used to track visitor statistics. These are anonymised data about the number of visitors, which pages they visit on this site, from which regions they visit, which web browsers they use, etc.. You will also see non-personalised ads via Google AdSense. Cookies from Paddle or Paypal are placed when you click on a 'Buy now!' or 'Donate!' button, and possible cookies from Disqus when you use that system to comment on one or more blogposts.
Privacy Statement