Top: f77 Up: 13 - Statements
Previous: 13,31 - EXTERNAL Next: 13,33 - FUNCTION


Section 13,32: FORMAT

 Defines the conversion of data in formatted data transfer
 operations.  Statement format:

    FORMAT (q1 f1s1 f2s2 ... fnsn qn)

    qn   Is zero or more slash (/) record terminators.

    fn   Is a field descriptor, an edit descriptor, or
         a group of field and edit descriptors enclosed
         in parentheses.

    sn   Is a field separator (a comma or slash).  A
         comma can be omitted in the following cases:

         o Between a P edit descriptor and an immediately
           following F, E, D, or G edit descriptor.

         o Before or after a slash (/) record terminator.

         o Before or after a colon (:) edit descriptor.

 The "field descriptor" has one of the following forms:

    [r]c  [r]cw  [r]cw.m  [r]cw.d[Ee]

    r    Is the optional repeat count.  (If you omit r, 
         the repeat count is assumed to be 1.)

    c    Is a format code (I,O,Z,F,E,D,G,L, or A).

    w    Is the external field width in characters.  Each
         data item in the external medium is called an 
         external field.

    m    Is the minimum number of characters that must appear 
         in the field (including leading zeros).

    d    Is the number of characters to the right of the decimal point.

    E    Is an exponent field.

    e    Is the number of characters in the exponent.

 The ranges for "r", "w", "m", "d", and "e" are as follows:

 Term      Range                 
 ----      __________                 
  r        1 to 2147483647 (2**31-1)  
  w        1 to 2147483647            
  m        0 to 32767 (2**15-1)       
  d        0 to 32767                 
  e        1 to 32767                 

 The terms must all be unsigned integer constants or variable format
 expressions.  A variable format expression is an integer variable
 or expression enclosed in angle brackets that takes the place of an
 integer constant.  The value of the variable or variables can
 change during program execution.

 You cannot use PARAMETER constants for "r", "w", "m", "d", or "e".

 The "edit descriptor" has one of the following forms:

    c  [n]c  c[n]
   
    c     Is a format code (X,T,TL,TR,SP,SS,S,BN,BZ,P,H,
          '...', "...", Q, $, or :).

    n     Is the optional number of characters or character
          positions.

 The term "n" must be an unsigned integer constant (for format code
 P, it can be signed or unsigned) or a variable format expression.
 A variable format expression is an integer variable or expression
 enclosed in angle brackets that takes the place of an integer
 constant.  The value of the variable or variables can change during
 program execution.

 The value of "n" for P must be within the range -128 to 127.  For
 all other format codes, the value of "n" must be within the range 1
 through 2147483647 (2**31-1); actual useful ranges may be
 constrained by record sizes (RECL) and the file system.

 For more information, see FORMAT_SPECIFIERS in this online Help
 file.


Top: f77 Up: 13 - Statements
Previous: 13,31 - EXTERNAL Next: 13,33 - FUNCTION