PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

RPG IV - V6R1 Enhancements: 3) LIKEFILE

Go down

RPG IV - V6R1 Enhancements: 3) LIKEFILE

Post  maran on Tue Sep 08, 2009 7:29 pm


The LIKEFILE keyword may also be used on the F-specs. Figure 7 shows an example of two files (CurrCust and OldCust) being defined like the Customer file. The processing options (file type, record addition, record address type, device, etc.) and most (but not all) of the keywords are inherited.

FCustomer IF E K Disk Template Block(*YES)

FCurrCust LikeFile(Customer)


FOldCust LikeFile(Customer)


Figure 7: Using LIKEFILE on the File Specifications.

There are a few items to bear in mind when using LIKEFILE:

• The parent file must be externally defined.

• Files are implicitly qualified; therefore, resulting data structures are required for input and output operations.

• The parent file must define any blocking requirements.

• Not all keywords are inherited. These are keywords that must be unique for each file (e.g., INDDS, INFDS, INFSR, OFLIND).

• Although the SFILE keyword may be inherited, you still need to define it for dependent files in order to specify a unique RRN field.

Posts : 442
Join date : 2009-07-24

View user profile

Back to top Go down

Back to top

Permissions in this forum:
You cannot reply to topics in this forum