2

Can anyone tell me how to create a PF with more than 1 record?

I tried the following:

 A**************************************************************************
 A*  Physical File
 A*-------------------------------------------------------------------------
 A
 A*            -------------------------------------------------------------
 A*            Record 01 - <Some description>
 A*            -------------------------------------------------------------
 A          R RAMPPF1
 A            D1SNAM        50A         ALIAS(SHIPNAME         )
 A            D1SADD        50A         ALIAS(SHIPADDRESS      )
 A            D1SCITY       50A         ALIAS(SHIPCITY         )
 A            D1SREGN        2A         ALIAS(SHIPREGION       )
 A            D1SPOST       10A         ALIAS(SHIPPOSTALCODE   )
 A            D1SCNTR       40A         ALIAS(SHIPCOUNTRY      )
 A            D1CSTID       80A         ALIAS(CUSTOMERID       )
 A            D1CNAM        50A         ALIAS(CUSTOMERNAME     )
 A            D1CADD        50A         ALIAS(ADDRESS          )
 A            D1CCITY       50A         ALIAS(CITY             )
 A* KEYS GO HERE
 A
 A*            -------------------------------------------------------------
 A*            Record 02 - <Some description>
 A*            -------------------------------------------------------------
 A          R RAMPPF2
 A            D2SNAM        70A         ALIAS(SHIPNAME         )
 A            D2SADD        60A         ALIAS(SHIPADDRESS      )
 A            D2SCITY       40A         ALIAS(SHIPCITY         )
 A            D2SREGN        2A         ALIAS(SHIPREGION       )
 A            D2SPOST       10A         ALIAS(SHIPPOSTALCODE   )
 A            D2SCNTR       40A         ALIAS(SHIPCOUNTRY      )
 A            D2CSTID       80A         ALIAS(CUSTOMERID       )
 A            D2CNAM        50A         ALIAS(CUSTOMERNAME     )
 A            D2CADD        50A         ALIAS(ADDRESS          )
 A            D2CCITY       50A         ALIAS(CITY             )
 A* KEYS GO HERE
 A
 A************************************************************************** 

As shown here

But when compiling this with 14 or with CRTPF command (CRTPF FILE(QTEMP/TST001P) SRCFILE(TSTLIB/QDDSSRC) SRCMBR(*FILE) I get an CPD7914

So what is wrong? The DDS definition or the compiling command? Since there are nearly no tutorials with multipe record formats out there in the internet, I haven't found a satisfying solution

Thanks in advance!

Radinator
  • 1,048
  • 18
  • 58
  • 1
    If you managed to solve your own problem, then please post an answer with your solution (and accept it after the timeout). Do not edit your solution into your question, and especially do not add things like SOLVED to your title. If you have follow-up questions, then consider posting a **new** question, linking to this question for context. – Mark Rotteveel Apr 17 '18 at 15:39

2 Answers2

5

An externally described PF can only have one format.

A logical file can have more than one format, each format is pulled from a different PF.

You'd have to go back to an internally described PF to have multiple formats in the PF. Don't do it!

Charles
  • 21,637
  • 1
  • 20
  • 44
2

The reference for DDS files states that Specify only one R because a physical file can contain only one record format.

Radinator
  • 1,048
  • 18
  • 58