Create an object using a source file

You can use a create command to create an object using a source file. If you create an object using a source file, you can specify the name of the source file on the create command.

For example, to create a control language program, you use the Create Control Language Program (CRTCLPGM) command. A create command specifies through a SRCFILE parameter where the source is stored.

The create commands are designed so that you do not have to specify source file name and member name if you follow this procedure:

  1. Use the default source file name for the type of object you are creating. To find the default source file name for the command you are using, see IBM-supplied source files.
  2. Give the source member the same name as the object to be created.
For example, to create the control language (CL) program PGMA using the command defaults, you can type:
CRTCLPGM PGM(PGMA)

The system would expect the source for PGMA to be in the PGMA member in the QCLSRC source file. The library containing the QCLSRC file would be determined by the library list.

As another example, the following Create Physical File (CRTPF) command creates the file DSTREF using the database source file FRSOURCE. The source member is named DSTREF. Because the SRCMBR parameter is not specified, the system assumes that the member name, DSTREF, is the same as the name of the object being created.
CRTPF FILE (QGPL/DSTREF) SRCFILE(QGPL/FRSOURCE)
Related concepts
IBM-supplied source files