How to write Multiple format for physical file using QDDSSRC create PF

45 pts.
Tags:
AS/400
Physical File
FOUNDATION PHYSICAL FILE USING QDDSSRC  CREATE F6
UNIQUE                    
R FORMAT01                                            
  FNO              5S         TEXT('FOUNDATION NUMBER') 
  NAME          50A         TEXT('FOUNDATION NAM')    
  ADD1          25A         TEXT('ADDRESS 1')         
  ADD2          25A         TEXT('ADDRESS 2')         
  CITY            30A         TEXT('CITY')              
  STATE           2A         TEXT('STATE')             
  ZIP               12A         TEXT('ZIP CODE')          
  COUNTRY    25A         TEXT('COUNTRY')           
  TEL              20A         TEXT('TELEPHONE NO')      
  EMAIL           45A         TEXT('EMAIL')             
  WEBSITE      70A         TEXT('WEBSITE NAME')      
K FNO 
                                               
R FORMAT02                                            
  FNO               5S         TEXT('FOUNDATION NUMBER') 
  NAME           50A         TEXT('FOUNDATION NAM')    
  BACKRND    50A         TEXT('BACKRND')  
      
K FNO
This isn't compiling correctly. What am I doing wrong?

Answer Wiki

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

Hi Sothonod,

Physical file cannot have more than one record format. Only logical and join logical files are allowed with more than 1 record format.

Discuss This Question: 4  Replies

 
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
  • WoodEngineer
    Your will need a program-described file to handle the multiple formats. 
    6,875 pointsBadges:
    report
  • philpl1jb

    On the AS/400 we see two physical files that are delivered by a single "multi-format" logical.  This technique isn't necessary for modern RPG programming and it isn't useful for SQL.

    We could. perhaps provide a better approach if you described your issue.

     

    51,355 pointsBadges:
    report
  • sothonod
    Thank you for the answer. OK I'll use a relative file with more than one format.
    Any documentation on how to link a Physical to a relative file using STDFU create DFU data entry for quick and dirty data entry?

    45 pointsBadges:
    report
  • philpl1jb

    I think you're already beyond this question ..

    You would create two physical files

    File1 - your format1 above

    File2 - your fomat2 above

    You can, if you wish Join these file by creating a join logical file.

    The Join file is not actually necessary for any processing on the AS/400,

    You could also go the SQL route creating your File 1 with a foreign key relationship into File2.  That would mean that no record could be added to File1 unless there was a related value in File2.

    51,355 pointsBadges:
    report

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