SOURCE FILE LOCATION


Contemporary RPG IV compilers accept source code from the highly structure database native to IBM's OS/400 operating systems (on which RPG IV originated) or from the flat-file systems such as those available under Linux, UNIX and Microsoft Windows operating systems. A version of the flat-file systems, referred to as the Integrated File System or "IFS", is also built into OS/400.

The OS/400 RPG IV compiler accepts and compiles source code from either file system.

Under the native OS/400 database, source code is stored in source file members. Under this database structure, database files contain members, members are the final element in the structure and members contain the actual data. Whereas under a flat-file system, the source file contains the actual source code.

To resolve this difference when using the flat-file system to store and compile source, most application development environments encourage the programmer to create a directory structure that simulates the native OS/400 database file structure. For example:

Under OS/400, the database file named QRPGLESRC has been created in the library named ORDENTRY. Within QRPGLESRC there are five source members that contain RPG IV source code. Those member names are as follows:

  1. ORDERS

  2. CUSTMAINT

  3. CUSTSCH

  4. PRTORD

  5. SHIPORD

To identify one of these source members to the compiler, the following command parameter syntax would be specified:

 CRTBNDRPG PGM(CUSTMAINT) SRCFILE(ORDENTRY/CUSTMAINT) SRCMBR(CUSTMAINT) 

Using the IFS to store source code is relatively uncommon in the OS/400 world, although flat-file systems are the standard practice for storing source code on all other operation systems. The CRTBNDRPG and CRTRPGMOD commands accept source from the IFS through the use of the SRCSTMF parameter.

The SRCSTMF parameter identifies the source file and the location of the source file in the IFS. When the SRCSTMF parameter is used the SRCFILE and SRCMBR parameters are not allowed. An error will occur if SRCFIEL and SRCMBR are specified with the SRCSTMF parameter. By default, the SRCSTMF parameter defaults to SRCSTMF(*NONE).

If an IFS directory structure named /mysrc/qrpglesrc has been created to store source code, and the source files named ORDERS, CUSTMAINT, CUSTSCH, PRTORD, SHIPORD are stored in the directory, the file names should be suffixed with the traditional SEU source type. In the case of RPG IV, this would be RPGLE. So these files would be referred to as follows:

 /mysrc/qrpglesrc/orders.rpgle /mysrc/qrpglesrc/custmaint.rpgle /mysrc/qrpglesrc/custsch.rpgle /mysrc/qrpglesrc/prtord.rpgle /mysrc/qrpglesrc/shipord.rpgle 

To compile any of these source members using the CRTRPGMOD command, the following command could be used:

 CRTRPGMOD MODULE(SHIPORD) SRCSTMF('/mysrc/qrpglesrc/shipord.rpgle') 




The Modern RPG IV Language
The Modern RPG IV Language
ISBN: 1583470646
EAN: 2147483647
Year: 2003
Pages: 156
Authors: Robert Cozzi

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net