AS/400,db2/400,rpg/400

pts.
Tags:
DB2/400
RPG
RPG/400
is there any perfect method to make externally described file fields available to a program

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

I’m not sure what you mean by perfect method, but you can either define the file as externally described (if you need to read/update etc the data in the file). Or you can define the file as an externally described data structure (if you only need the field definitions from the file).

Regards,

Martin Gilbert.

==========================================================

Of course there is a method. If there wasn’t, there would be no point to the concept of “externally-described” files in the first place.

In RPG, you simply reference the file on a F-spec and mark it as ‘E’xternally described:<pre>
FEFNAME IF <b>E</b> K Disk</pre>
In COBOL, you reference the file in a SELECT…ASSIGN statement, and you place a COPY statement wherever you want the fields defined, e.g., under a FD 01-level record name or under an 01-level WORKING STORAGE item:<pre>
copy ddr-all-formats of EFNAME.</pre>
In CL, you simply declare the file with DCLF and the fields are brought in below the DCLF.

Tom

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following