PIPE Files

attr := DATASET( file, struct, PIPE( command [, CSV | XML ]) );

PIPESpecifies the filecomes from the commandprogram. This is a "read" pipe.
commandThe name of the program to execute, which must output records in the struct format to standard output.
CSVOptional. Specifies the output data format is CSV. If omitted, the format is raw.
XMLOptional. Specifies the output data format is XML. If omitted, the format is raw.

This form uses PIPE(command) to send the file to the command program, which then returns the records to standard output in the struct format. This is also known as an input PIPE (analogous to the PIPE function and PIPE option on OUTPUT).

Example:

PtblRec := RECORD
  STRING2 State;
  STRING20 City;
  STRING25 Lname;
  STRING15 Fname;
END;
         
Ptbl := DATASET('~LR::TestFile',
                PtblRec,
                PIPE('ProcessFile'));
          // ProcessFile is the input pipe