Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

STRING with QUOTES around each field 1

Status
Not open for further replies.

SiouxCityElvis

Programmer
Jun 6, 2003
228
US
Hello,
I'm using RMCOBOL-85 on Linux...

I just have a quick question you probably know...
I saw in the Lang Ref manual on page 1-15 that QUOTE Represents a constant not a literal. It says
"cannot delimit a non-numeric literal".

I'm trying to output something like

"M","Field1, Inc.","etc"

WS.
01 WS-TYPE PIC X(1).
01 WS-FIELD1 PIC X(200).
01 WS-ETC-FIELD PIC X(10).

....
....
MOVE "M" TO WS-TYPE.
MOVE "Field 1, Inc." TO WS-FIELD1.
MOVE "etc" TO WS-ETC-FIELD.

STRING
WS-TYPE DELMITED BY SIZE
WS-FIELD1 DELIMITED BY SPACES
WS-ETC-FIELD DELIMITED BY SPACES
END-STRING

How do I get the results to show as

"M","Field1, Inc.","etc"

instead of
M,Field1, Inc.,etc

Thanks.
-David
 
Hi David,

This should do it:
Code:
STRING 
    '"' DELIMITED BY SIZE 
    WS-TYPE DELIMITED BY SIZE
    '","' DELIMITED BY SIZE    
    WS-FIELD1 DELIMITED BY SPACES
    '","' DELIMITED BY SIZE    
    WS-ETC-FIELD DELIMITED BY SPACES
    '"' DELIMITED BY SIZE 
END-STRING

Tom Morrison
 
Have you tried something like this:
Code:
STRING
    QUOTE DELIMITED BY SIZE
    WS-TYPE DELMITED BY SIZE
    QUOTE DELIMITED BY SIZE
    "," DELIMITED BY SIZE
    QUOTE DELIMITED BY SIZE
    WS-FIELD1 DELIMITED BY SPACES
    QUOTE DELIMITED BY SIZE
    "," DELIMITED BY SIZE
    WS-ETC-FIELD DELIMITED BY SPACES
    QUOTE DELIMITED BY SIZE
  INTO [i]YourResultString[/i]
END-STRING

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top