|
In a message dated 00-01-06 10:43:01 EST, you write: > Do I have to create a Data structure listing all my fields in my > program? If so, it would be just as easy to internally describe > the file then. I don't want to have to list the fields in my program. You use this syntax to create the data structures: d UBCntrol01 e ds extname(UB01File) d UBCntrol02 e ds extname(UB02File) d UBCntrol03 e ds extname(UB03File) Where UBCntrolXX is the data structure name and UBXXFile is the external file with the field names. You will need a separate file for each kind of record and you must create the file, but it need not have any data. If you want the data structure to have the same name as the file, you can omit the extname() keyword. You do not actually open these files in the program, you don't have an F spec for them, and you don't read them in the program. This just creates a data structure with the fields named and defined as in the DDS. This means you don't have to define the fields internally. > My physical file will have one field, maybe I'll call it UBBUFF. > I can't say MOVEL UBCntrol01 UBBUFF can I? > UBCntrol01 being my record format name for the header DDS. Yes, you can. Except UBCntr01 is the data structure name, not the record format name. Make UBBUF big enough for the longest record, populate the subfields and movel (or eval) the data structure name into UBBUFF and write UBBUFF. Works great! HTH, Lance +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.