writing csv file


I read the discussion about parsing csv. But my problem is different. I am writing a file in csv format. When I write double quotes (") in to a work file, it becomes single quotes (’). How to over come this. Kindly post your suggestions. Thanks in advance.


Two things come to mind quickly, either modify your TQ Natural parameter or use the hex value. I.E. 01 #DQ (A1) CONST<H’7F’> /* mainframe hex value


Two possible solutions:

  1. The the Natural Session-Parameter TQ=OFF
  2. Use the Hexadecimal value of the quote
define data local
01 #a40 (A40)
#a40 := 'Here is a double-quote: "'
display #a40
compress 'Here is a double-quote:' H'22' into #a40
display #a40

Very quick indeed. Sorry Chad! I promise: I didn’t copy your answer! :oops:

Great minds!! :smiley:

:wink: …or add


to your program source.

:oops: But works only with newer Natural releases.

Interesting hint! I never heard about that option. But it doesn’t work on my Nat61117 for Windows and for Solaris.
The Natural online help tells something about dialogs…

:idea: Natural 4.1.2 Release Notes for Mainframes
:arrow: Programming Language Enhancements
:arrow: New Compiler Options

:idea: Natural Planning Guide Version 4.2.1 for Mainframes & Version 6.2.1 for Windows, UNIX and Linux
:arrow: Natural Version 6.2.1 for Windows, Unix, and Linux
:arrow: OPTIONS Statement

The mainframe hea decimal value H’7F’ works for me. Thanks.