Using the PUT statement

If you need to prepare a data file in a fixed format, perhaps for use by another system, you can use the PUT statement, as shown in the i-putdat.p procedure.

i-putdat.p

OUTPUT TO i-datfl8.d.
FOR EACH Customer NO-LOCK:
  PUT Customer.CustNum AT 1 Customer.Name AT 10 Customer.SalesRep AT 40 SKIP.
END.
OUTPUT CLOSE.

The output from i-putdat.p is written to i-datfl8.d.

i-datf18.d

     1        Lift Line Skiing         HXM
     2        Urpon Frisbee            DKP
     3        Hoops Croquet Comp       HXM
     4        Go Fishing Ltd           SLS
     5        Match Point Tennis       JAL
            .
            .
            .

The PUT statement formats the data into the columns specified with the AT options. Only the data is output: there are no labels and no box. The SKIP option indicates that you want each customer's data to begin on a new line.

For more information on the PUT statement, see ABL Reference.