HELPLIB.HLB  —  FORTRAN  Format Specifiers
present, the external field consists of at least "m" digits and, if necessary, is zero filled on the left. "w" must be large enough to include a possible minus sign. If "m" is present, the external field consists of at least "m" digits and, if necessary, is zero filled on the left.

26  –  P

  nP (Scale Factor Editing)

  The scale factor lets you alter, during input or output, the
  location of the decimal point both in real values and in the two
  parts of complex values.

  The "n" is a signed or unsigned integer constant, in the range -128
  to 127, that specifies the number of positions to the left or right
  that the decimal point is to move.

  A scale factor can appear anywhere in a format specification, but
  must precede the first F, E, D, EN, ES, or G field descriptor that
  is to be associated with it and affects all subsequent real field
  descriptors in the same FORMAT statement (unless another scale
  factor appears).

  On input the scale factor of any of the F, E, D, EN, ES, and G
  field descriptors multiplies the data by 10**-n and assigns it to
  the corresponding I/O list element.  For example a 2P scale factor
  multiplies an input value by .01; a -2P multiplies an input value
  by 100.  However, if the external field contains an explicit
  exponent, the scale factor has no effect.

  E, D, EN, ES, and G field descriptors alter the form in which data
  is transferred.  On input a positive scale factor moves the decimal
  point to the left and a negative scale factor moves the decimal
  point to the right; on output, the effect is the reverse.

26.1  –  F editing

  nPFw.d

  On output, the value of the I/O list element is multiplied by 10**n
  before transfer to the external record.  Thus, a positive scale
  factor moves the decimal point to the right; a negative scale
  factor moves the decimal point to the left.  Thus, the F descriptor
  alters the magnitude of the data.

26.2  –  E editing

  nPEw.d

  On output, the basic real constant part of the I/O list element is
  multiplied by 10**n, and "n" is subtracted from the exponent.  For
  a positive scale factor, "n" must be less than d+2 or an output
  conversion error occurs.  Thus, a positive scale factor moves the
  decimal point to the right and decreases the exponent; a negative
  scale factor moves the decimal point to the left and increases the
  exponent.

26.3  –  D editing

  nPDw.d

  On output, the basic real constant part of the I/O list element is
  multiplied by 10**n, and "n" is subtracted from the exponent.  For
  a positive scale factor, "n" must be less than d+2 or an output
  conversion error occurs.  Thus, a positive scale factor moves the
  decimal point to the right and decreases the exponent; a negative
  scale factor moves the decimal point to the left and increases the
  exponent.

26.4  –  EN editing

  On output, the scale factor has no effect on EN editing.

26.5  –  ES editing

  On output, the scale factor has no effect on ES editing.

26.6  –  G editing

  nPGw.d

  On output, the effect for the G field descriptor is suspended if
  the magnitude of the data to be output is within the effective
  range of the descriptor (because the G field descriptor supplies
  its own scaling function).  It functions as an E field descriptor
  if the magnitude of the data is outside its range.  In this case,
  the scale factor has the same effect as for the E field descriptor.

27  –  Q

  (Query Remaining Character Count)

  On input, Q obtains the number of characters remaining in the input
  record to be transferred during a read operation.  The following
  example uses the Q descriptor to determine the size of the input
  record:

     READ(5,'(Q,A)') LEN, REC(1:LEN)

  On output, the Q descriptor has no effect, except that the
  corresponding I/O item is skipped.

28  –  S

  (Normal Signing)

  Restores the option of producing plus characters (+) in numeric
  output fields.  The S descriptor counters the action of either the
  SP or SS descriptor by restoring to the processor the discretion of
  producing plus characters on an optional basis.

  This descriptor affects fields all that follow it, until an SP or
  SS is encountered.  The S descriptor affects all subsequent I, F,
  E, D, and G editing (in the same FORMAT statement) during the
  execution of an output statement.

29  –  SP

  (Always + Signs)

  Causes the processor to produce a leading plus character (+) in any
  position where this character would otherwise be optional.

  This descriptor affects all (suppress + signs) fields that follow
  it, until an S or SS is encountered.  The SP descriptor affects all
  subsequent I, F, E, D, and G editing (in the same FORMAT statement)
  during the execution of an output statement.

30  –  SS

  (Suppress Sign)

  Causes the processor to suppress a leading plus character from any
  position where this character would otherwise be optional.  It has
  the opposite effect of the SP field descriptor.

  The SS descriptor affects all subsequent I, F, E, D, and G editing
  (in the same FORMAT statement) during the execution of an output
  statement.  This descriptor affects all fields that follow it,
  until an S or SS is encountered.

31  –  Slash

  [r]/

  Terminates data transfer for the current record and starts data
  transfer for a new record.  The "r" is an optional repeat
  specification.

  Multiple slashes cause the system to skip input records or to
  output blank records, as follows:

   o  When "n" consecutive slashes appear between two edit
      descriptors, "n"-1 records are skipped on input, or "n"-1 blank
      records are output.  The first slash terminates the current
      record.  The second slash terminates the first skipped or blank
      record, and so on.

   o  When "n" consecutive slashes appear at the beginning or end of
      a format specification, "n" records are skipped or "n" blank
      records are output, because the opening and closing parentheses
      of the format specification are themselves a record initiator
      and terminator, respectively.

32  –  T

  Tn (Tab to Position n)

  On input, starts the next read operation at the character position
  (within the record) indicated by position n.  For example, if an
  input statement reads a record containing:

     ABC   XYZ

  and this record is under the control of the FORMAT statement:

     10 FORMAT (T7,A3,T1,A3)

  On execution, the input statement would first read the characters
  XYZ and then read the characters ABC.

  On output, starts the next write operation at the character
  position n in the external record.

  The position specified must be an integer in the range 1 through
  the size of the record.

33  –  TL

  TLn (Tab Left n Positions)

  Indicates that the next character to be transferred to or from a
  record is the "n"th character to the left of the current character.

  The value of "n" must be greater than or equal to 1.

  If the value of "n" is greater than or equal to the current
  character position, the first character in the record is specified.

34  –  TR

  TRn (Tab Right n Positions)

  Indicates that the next character to be transferred to or from a
  record is the "n"th character to the right of the current
  character.

  The value of "n" must be greater than or equal to 1.

35  –  X

  nX (Skip Right n Positions)

  The X field descriptor functions the same as the TR field
  descriptor.

  On input, X starts the next read operation after skipping "n"
  character positions.  If X is the last format item, it will have no
  effect.

  On output, X starts the next write operation after skipping the "n"
  character positions.  Intervening characters are not written over.
  If X is the last format code executed, it will have no effect.

  The position specified must be in integer in the range 1 through
  the size of the record.

36  –  Z

  Zw[.m] (Hexadecimal Editing)

  On input, Z transfers "w" characters from the external field and
  assigns them, as a hexadecimal value, to the corresponding I/O list
  element (which can be any data type).  The input value must be in
  the form of a hexadecimal constant.  Each input character
  corresponds to four bits in the variable, high order to low order.
  If the input value contains more characters than specified by "w",
  an error occurs.  If the input value contains fewer characters, it
  is padded with zeros on the left before being converted.

  On output, Z transfers the number of hexadecimal characters
  specified by "w" from a variable or constant to the record.  The
  rightmost characters represent the low-order bits.  If the variable
  or constant contains more characters than "w" specifies, the value
  is set to all asterisks (an error occurs).  If the variable or
  constant contains fewer characters, the value is padded on the left
  with spaces.  "m" specifies the minimum number of characters (with
  zero padding) that the value can contain.  "m" must be an integer
  in the range 1 through 255.  "w" must be large enough to include a
  possible minus sign.  If "m" is present, the external field
  consists of at least "m" digits and, if necessary, is zero filled
  on the left.
Close Help