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
 
How to delimit data with '|' which has quotes and apostrophe

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
gch77

New User


Joined: 16 Mar 2009
Posts: 13
Location: Chennai

PostPosted: Wed Aug 13, 2014 9:16 am    Post subject: How to delimit data with '|' which has quotes and apostrophe
Reply with quote

My input is :
Code:
FIRST" NAME                     123456789ADDRESS LINE '1


and I need the output to be:
Code:
FIRST" NAME|123456789|ADDRESS LINE '1|


I tried using the SQZ/JFY options in DFSORT as below.

Code:
//SYSIN    DD *                                             
   OPTION COPY                                             
   INREC IFOUTLEN=88,                                       
    IFTHEN=(WHEN=INIT,                                     
     BUILD=(1:1,50,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'|"'),     
     54:51,9,JFY=(SHIFT=LEFT),C'|',                         
     64:60,24,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'|"'))),
    IFTHEN=(WHEN=INIT,                                     
     OVERLAY=(1,88,SQZ=(SHIFT=LEFT,PAIR=QUOTE))),       
    IFTHEN=(WHEN=INIT,                                     
     FINDREP=(IN=C'"',OUT=C''))                         
/*


But it works perfectly only if my data doesnt have double quotes.

Please suggest me on how to handle this if data has " and ' also.

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

gch77

New User


Joined: 16 Mar 2009
Posts: 13
Location: Chennai

PostPosted: Wed Aug 13, 2014 11:22 am    Post subject: Reply to: How to delimit data with '|' which has quotes and
Reply with quote

Please advise icon_sad.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Wed Aug 13, 2014 11:31 am    Post subject: Reply to: How to delimit data with '|' which has quotes and
Reply with quote

Use FINDREP to change problematic character to a value which can't naturally occur in your data (X'FD', something like that). Then, after processing, use FINDREP to reverse that change.
Back to top
View user's profile Send private message
gch77

New User


Joined: 16 Mar 2009
Posts: 13
Location: Chennai

PostPosted: Wed Aug 13, 2014 11:58 am    Post subject: Reply to: How to delimit data with '|' which has quotes and
Reply with quote

Perfect ! thank you. it just dint strike me before. Thanks a lot.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Wed Aug 13, 2014 12:00 pm    Post subject: Re: Reply to: How to delimit data with '|' which has quotes
Reply with quote

gch77 wrote:
Please advise icon_sad.gif


You're lucky I didn't see that before posting. You want it quick, you want to ask how it's going, then you find someone to pay to do it.

Here, you come for free. Acting like you're paying for it tends to reduce your chance of an answer.

It is not a complex process to come up with the answer. "This character causes a problem - if only it weren't there..." but "I do need that character after I've finished messing around".
Back to top
View user's profile Send private message
gch77

New User


Joined: 16 Mar 2009
Posts: 13
Location: Chennai

PostPosted: Thu Aug 14, 2014 9:00 am    Post subject: Reply to: How to delimit data with '|' which has quotes and
Reply with quote

Quote:
You want it quick, you want to ask how it's going, then you find someone to pay to do it.

Here, you come for free. Acting like you're paying for it tends to reduce your chance of an answer.


Sorry. I was also trying at my end to resolve the issue but just wanted seek some expert help who could give me a hint so that I shall change the way of my attempt to resolve the issue.

Thanks for helping me.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am

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