HP OpenVMS Systems

ask the wizard
Content starts here

COBOL and parsing text records (CSV file)?

» close window

The Question is:

I'm looking for a way to convert a .csv file into an rms sequential file that
 can then be read by a cobol program on the Alpha.
The csv file will contain text and also dollar fields containing decimal points
 and commas (ie "5,170.50")
Do I need to create a program to strip out these
editing characters so they can be stored for
instance as pic 9(6)v99 ?
thank you.

The Answer is :

  Converting CSV files with a DCL command procedure would be trivial,
  and the DCL can pre-process and load the data into a file that can
  then be accessed from COBOL -- F$ELEMENT, OPEN, WRITE and other
  such tools would be used.  COBOL itself can certainly read such
  files, given its string capabilities.

answer written or last revised on ( 23-MAR-2004 )

» close window