HP3000-L Archives

September 2015, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
mark Undrill <[log in to unmask]>
Reply To:
mark Undrill <[log in to unmask]>
Date:
Thu, 3 Sep 2015 20:07:34 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (100 lines)
On 03/09/2015 19:38, Francois Desrochers wrote:
> Ernie,
>
>
>
> How about putting the whole thing inside single-quotes?
>
>
>
> VALUE '"item one", "item two","","","item three"'.
>
>
>
> This works fine if the value is static. If <item one>, etc. are variables, you should look into using the STRING statement.
>
>
>
> STRING '"' DELIMITED BY SIZE
>
>         ITEM-ONE DELIMITED BY SIZE
>
>        '","' DELIMITED BY SIZE
>
>        ITEM-TWO DELIMITED BY SIZE
>
>         '","","","' DELIMITED BY SIZE
>
>         ITEM-THREE DELIMITED BY SIZE
>
>         '"'
>
> INTO TARGET-VAR.
>
>
>
> There is more to it than this but should get you started.
>
>
>
> HTH
>
> François
>
>
>
> -----Original Message-----
> From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On Behalf Of Newton, Ernie
> Sent: September-03-15 1:47 PM
> To: [log in to unmask]
> Subject: [HP3000-L] Fun with COBOL
>
>
>
> Greetings,
>
>
>
> It's been a long time since I wrote COBOL, and I have an elementary question about creating a comma-delimited file.
>
>
>
> If I want...
>
>
>
> "item one", "item two","","","item three"
>
>
>
> How do I create the "," between item one and item two?  Is it simply PIC "","" (quote comma quote inside double quotes?)
>
>
>
> And the ","",""," would it be the same?  Just put that inside double quotes?
>
>
>
> Something tells me that there is an escape sequence, but the mind is not cooperating.
>
>
>
> Thanks,
>
>
>
> Ernie
>
>
>
Just to add to the fun there is a reserved word QUOTE that gets you a 
quote sign. That's a " BTW.

-- 
Mark Undrill
ScreenJet Limited
+44 1684 291710

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2