View previous topic :: View next topic
|
Author |
Message |
gch77
New User
Joined: 16 Mar 2009 Posts: 13 Location: Chennai
|
|
|
|
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 |
|
|
gch77
New User
Joined: 16 Mar 2009 Posts: 13 Location: Chennai
|
|
|
|
Please advise |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
gch77
New User
Joined: 16 Mar 2009 Posts: 13 Location: Chennai
|
|
|
|
Perfect ! thank you. it just dint strike me before. Thanks a lot. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
gch77 wrote: |
Please advise |
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 |
|
|
gch77
New User
Joined: 16 Mar 2009 Posts: 13 Location: Chennai
|
|
|
|
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 |
|
|
|