Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To change double quotes into csv readable format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
venkatatcts

New User


Joined: 16 Mar 2009
Posts: 55
Location: India

PostPosted: Fri Feb 19, 2016 8:13 am    Post subject: To change double quotes into csv readable format
Reply with quote

Hi,

There is a character field of length 50 which has special characters like "string1". I want to add double quotes to it. For example,

New York financial "times" to
New York financial ""times""

New York is "a" city to
New York is ""a"" city

The double quote string is dynamic in the field of length.

Thanks in advance
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8212
Location: Dubuque, Iowa, USA

PostPosted: Fri Feb 19, 2016 8:53 am    Post subject:
Reply with quote

Reference modification or redefinition into an array will work. You need your original variable and an output variable; just move character by character from the input to the output variable, checking to see if you have the double quote mark character and if so adding another one to the output variable.

Questions you need to investigate:
- what happens if the copied data is more than 50 bytes with the extra quotes?
- are you limited to only one pair of quotes per line?
- will you always have paired quotes, or can you have just a single one? if a single one is possible, does it get doubled in the output?

And nothing you posted has anything to do with a .csv file, so why did you mention it in your title?
Back to top
View user's profile Send private message
venkatatcts

New User


Joined: 16 Mar 2009
Posts: 55
Location: India

PostPosted: Fri Feb 19, 2016 8:56 am    Post subject: Reply to: To change double quotes into csv readable format
Reply with quote

Thanks,

Is there any sample code which I could refer. Thanks
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8212
Location: Dubuque, Iowa, USA

PostPosted: Fri Feb 19, 2016 6:19 pm    Post subject:
Reply with quote

This is a forum for experts -- who won't need sample code, especially for such a simple task. Perhaps you should go the Beginner's and Students Forum instead?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am
No new posts How to change the logon screen info o... sakthikumarT TSO/ISPF 4 Fri Dec 29, 2017 6:44 pm
No new posts Change NULL indicator in UNLOAD utility Khadhar Basha DB2 2 Fri Dec 15, 2017 3:01 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 5 Tue Oct 24, 2017 12:01 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us