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

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

Join the forum, it's quick and easy

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

Get Answers for all your queries on IBM i (AS/400).
PMS Information Systems
Would you like to react to this message? Create an account in a few clicks or log in to continue.

RPG IV - V6R1 Enhancements: 3) LIKEFILE

Go down

RPG IV - V6R1 Enhancements: 3) LIKEFILE Empty RPG IV - V6R1 Enhancements: 3) LIKEFILE

Post  maran Tue Sep 08, 2009 7:29 pm

LIKEFILE

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)

F ExtFile('CURRLIB/CUSTFILE')

FOldCust LikeFile(Customer)

F ExtFile('OLDLIB/CUSTFILE')

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.
maran
maran
Admin

Posts : 442
Join date : 2009-07-24

https://pmsinformationsystem.forumotion.net

Back to top Go down

Back to top

- Similar topics

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