I fully agree with everything you state.
   
  However, the fact of the matter is that 
  CRTSRCPF
  CRTPF
  fopen
  all can create files that will have a record format associated with them 
(DSPFD).  This defaults to the same name as the file.
   
  If I want to rename this entity to something else, I can rename the file and 
member names only.  I cannot find a way to rename the record format, (or to 
name the record format to a different name in the first place).
Scott Klement <c400-l@xxxxxxxxxxxxxxxx> wrote:
  A record format name is a name that's assigned to a particular format of 
a record. In other words, to the field names, data types, and positions 
within the record that makes up the format.
Therefore, if you want to specify a record format name, you must also 
specify all of the field details!
In V5R4, you can specify a record format name from within an SQL Create 
Table statement.
In previous releases, the only way to (directly) specify the record 
format name is with DDS source.
It can't be done with fopen(), because fopen() doesn't let you specify 
the fields and their attributes. But, your C program could create a 
temporary source PF in QTEMP, write DDS to that source PF, and then run 
the CRTPF command to create a file with the fields and record format 
information all specified.
GASPARE LATONA wrote:
When creating a new file in QSYS using fopen, is there any way of
specifying the record format name?
Alternatively, once the file is created, is there any way of changing
the record format name (of a program described physical file)?
Alternatively, how can I create a physical file from my c program and
specify my own record format name?
 
As an Amazon Associate we earn from qualifying purchases.