Replace Two Qutoes by One Quote

IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER
knobi
Posts: 9
Joined: Thu Aug 13, 2009 9:36 am
Skillset: jcl sort
Referer: google

Replace Two Qutoes by One Quote

Postby knobi » Tue Jan 19, 2021 5:46 pm

Good morning, I've DFSort job doing many things, and so far it's running without problems.
Now data format has changed and we start receiving lines with consecutive quotes.
How could I replace two consecutive quotes by One quote ?

Code: Select all


Input :
123456789012345678901234567890123456789012345678901234567890
' ajskdjaskj '    '    aksjdkasjdkjdk'
 



Code: Select all

Output :
' ajskdjaskj '    aksjdkasjdkjdk'


Quote's position doesn't really matter. Only one is gone.
I'm trying with this but with no success :

Code: Select all

   INREC IFTHEN=(WHEN=INIT,FINDREP=(IN=c' ' '', OUT=c' ' '))




Any help is welcome ! Thanks

User avatar
sergeyken
Posts: 458
Joined: Wed Jul 24, 2019 10:12 pm
Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
Referer: Internet search

Re: Replace Two Qutoes by One Quote

Postby sergeyken » Tue Jan 19, 2021 9:37 pm

The syntax of your FINDREP is wrong.
This job cannot run at all; RC=8, or 12 is expected

Please, present your code which can run without SORT errors

P.S.
It is not clear from your example, what is the expected “correct” output?
There are no “double quotes” at all...
Javas and Pythons come and go, but JCL and SORT stay forever.


  • Similar Topics
    Replies
    Views
    Last post