Creating 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:
For example, to create the control language (CL) program PGMA using the command defaults, you can type:
- 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.
- Give the source member the same name as the object to be created.
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)
- Creating an object from source statements in a batch job
If your create command is contained in a batch job, you can use an inline data file as the source file for the command.
- Determining which source file member was used to create an object
When an object is created from source, the information about the source file, library, and member is held in the object. The date and time when the source member was last changed before object creation is also saved in the object.
Parent topic:
Using source files
Related concepts
IBM-supplied source files