# writing csv file

**URL:** <https://techcommunity.softwareag.com/t/writing-csv-file/60739>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-on-Windows-Unix\
**Created:** [March 30, 2006, 8:49pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739 "2006-03-30T20:49:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vasanth](https://avatars.discourse-cdn.com/v4/letter/v/85e7bf/32.png) [@Vasanth](https://techcommunity.softwareag.com/u/Vasanth)\
**Post date:** [March 30, 2006, 8:49pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739/1 "2006-03-30T20:49:47Z")

</div>

Hi

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.

Regards  
Vasanth

---

<div class="post-metadata">

**Author:** ![Chad\_Scott](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@Chad\_Scott](https://techcommunity.softwareag.com/u/Chad_Scott)\
**Post date:** [March 30, 2006, 8:59pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739/2 "2006-03-30T20:59:45Z")

</div>

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

Chad.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [March 30, 2006, 9:03pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739/3 "2006-03-30T21:03:57Z")

</div>

Two possible solutions:

1. The the Natural Session-Parameter TQ=OFF
2. Use the Hexadecimal value of the quote

```auto
define data local
01 #a40 (A40)
end-define
#a40 := 'Here is a double-quote: "'
display #a40
compress 'Here is a double-quote:' H'22' into #a40
display #a40
end
```

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [March 30, 2006, 9:08pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739/4 "2006-03-30T21:08:18Z")

</div>

> [@Chad Scott](#):
>
> Two things come to mind quickly,

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

---

<div class="post-metadata">

**Author:** ![Chad\_Scott](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@Chad\_Scott](https://techcommunity.softwareag.com/u/Chad_Scott)\
**Post date:** [March 30, 2006, 9:57pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739/5 "2006-03-30T21:57:59Z")

</div>

Great minds!! 😃

---

<div class="post-metadata">

**Author:** ![Weihnachtsbar](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/weihnachtsbar/32/146_2.png) [@Weihnachtsbar](https://techcommunity.softwareag.com/u/Weihnachtsbar)\
**Post date:** [March 31, 2006, 3:40pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739/6 "2006-03-31T15:40:04Z")

</div>

😉 …or add

```auto
OPTIONS TQMARK=OFF
```

to your program source.

:oops: But works only with newer Natural releases.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [March 31, 2006, 5:21pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739/7 "2006-03-31T17:21:07Z")

</div>

> [@](#):
>
> 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…

---

<div class="post-metadata">

**Author:** ![Weihnachtsbar](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/weihnachtsbar/32/146_2.png) [@Weihnachtsbar](https://techcommunity.softwareag.com/u/Weihnachtsbar)\
**Post date:** [April 3, 2006, 1:12pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739/8 "2006-04-03T13:12:34Z")

</div>

: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

---

<div class="post-metadata">

**Author:** ![Vasanth](https://avatars.discourse-cdn.com/v4/letter/v/85e7bf/32.png) [@Vasanth](https://techcommunity.softwareag.com/u/Vasanth)\
**Post date:** [April 6, 2006, 4:20pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739/9 "2006-04-06T16:20:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:40pm UTC](https://techcommunity.softwareag.com/t/writing-csv-file/60739/10 "2021-04-02T14:40:32Z")

</div>


