How to insert double quotes in a flat file

2630 pts.
Tags:
AS/400 Subfiles
CPYTOIMPF
Hi everyone,
I want to insert data in double quotes within a single record. Later I want to split it up.
Actually I want to insert column headings in flat file like
"sr.no","name","product"
 later when I open the file in excel file it should get in different columns
Thanks

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can do it using the concat function and set your quotes to a constant. Another option is set it up as a data structure. My preference would be to use the concat function.

Eval flat_text = fld1 + QUOTE + fld2 + QUOTE + fld3 …..

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • WoodEngineer
    In our shop we use the technique ToddN suggested.  It simplifies the code and speeds program development.
    6,875 pointsBadges:
    report
  • hunshabbir7
    I found the thing which was creating problem. Actually I was building a string like I mentioned above and writing it in flat file with CPYTOIMPF comand for column headings and attaching this flat file with a data file  generated with CPYTOIMPF. There I used STRDLM(*NONE) with my heading command and all things worked correctly. Thanks for replying.
    2,630 pointsBadges:
    report
  • hunshabbir7
    Actually by default this parameter is STRDLM(*DBLQUOTE) when you write double quote in string from RPG code it duplicates it. So when using *NONE it leave placing quotes around strings. So where ever you want place your double quotes.
    2,630 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following