• Subject: Re: Can a PF have >1 record format?
  • From: Jim Langston <jimlangston@xxxxxxxxxxxxxxxx>
  • Date: Tue, 09 Jan 2001 10:13:44 -0800
  • Organization: Pacer International


No.  This has been a thorn in my side for a long time.  It was very
common in the S36 days to have a single file with two different file
formats, but with DDS you can only specify one of the formats.  I have
tried different things with join logicals, etc.. to no avail.

I finally found a solution that works.

I give no DDS to the file itself.  I then create 2 physical files with
the DDS for the file layouts for the 2 records.  These files never contain
any data.  In my program I open the real file as program defined.  I then
add ot my D-Specs an external data structure to those two files I made with
the DDS of the record layouts.  This here is a real world example of how this
looks and works.  Please note that although I am opening these up as Primary
files, they work just fine as full procedural.  This snippet was taken from
a one shot file update program I wrote:

FARFILE    UP   F  222        DISK                      
D FileNM_DS     E DS                  ExtName(ARFileNM) 
D                                     Based(FileNM_DS@) 
D                                     Prefix(NM_)       
D FileNM_DS@      S               *                     
D FileCR_DS     E DS                  ExtName(ARFileCR) 
D                                     Based(FileCR_DS@) 
D                                     Prefix(CR_)       
D FileCR_DS@      S               *                     
IARFile    NS                                           
I                                  1  222  ARBuffer     

C     *InzSR        BegSR                                  
C                   Eval      FileNM_DS@ = %Addr(ARBuffer) 
C                   Eval      FileCR_DS@ = %Addr(ARBuffer) 
C                   EndSr                                  

Date: Tue, 9 Jan 2001 08:51:00 -0500
From: D.BALE@handleman.com
Subject: Can a PF have >1 record format?

I asked this last week and got one response (thanks, Peter!) but would
appreciate a little more discourse on the topic.  The help for CPYF seems to
imply that a PHYSICAL file can have multiple record formats.  Am I missing
something?  I am already familiar with logical files having mulitple record

Can someone educate me how the RCDFMT parameter on the CPYF command is used on
a physical file?  Is this something that would be used for a non-described,
multi-format file (i.e., S/36-style Header & Detail formats combined into one

The help on my v3r2 says (and v4r4 softcopy is similar):

             Record format of logical file (RCDFMT) - Help

Specifies, for copying from a database file only, the name of the record
format that is copied.  If the from-file is not a logical or physical file,
*ONLY is the only value allowed.  A record format name is optional if the
logical file has only a single record format, but either a format name or
*ALL must be specified if the from-file has more than one record format.

The possible values are:

    The only record format in the from-file is copied.  When
    the from-file is a logical file, this value is allowed
    only if the file has a single record format.

    All record formats in the logical from-file are used.

    Specify the name of the record format that is copied
    when the from-file is a logical or physical file.

Dan Bale
IT - AS/400
Handleman Company
248-362-4400  Ext. 4952
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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 thread ...

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 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.