IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Remove Quotes using single Sort step?


 
IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: :: View next topic  
Author Message
Govardhana krishna

New User


Joined: 29 Apr 2008
Posts: 9
Location: INDIA

PostPosted: Thu Oct 17, 2013 9:05 pm
Reply with quote

Hi,
The data in the sting is mixed with Alpha numeric & numeric and every field is separated by comma. (,). but all the alphanumeric fields has a additional quotes in it.

But i need to remove the additioanl quotes from Alphanumeric fields in order to perform unstring by comma to use the data.

Example 1:
'"600","CY",8,"3787660","000043877",14099.83,1166.96,"USD"'.

But I need the above record as shown below:
EXAMPLE2:
'600,CY,8,3787660,000043877,14099.83,1166.96,USD'.

So that i can unstring the data shown in exapmle 2 using just ','.


Note:
I managed to remove the quotes using ICETOOL Replace command but it takes 4 step procedure to remove .

But is there any way by using single sort/icetool step to achive as shown above to remove the additional quotes in alphanumeric fields?

Thanks,
Govi.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Thu Oct 17, 2013 9:16 pm
Reply with quote

A simple FINDREP in a SORT step should do. What are your four ICETOOL steps, please?
Back to top
View user's profile Send private message
Govardhana krishna

New User


Joined: 29 Apr 2008
Posts: 9
Location: INDIA

PostPosted: Thu Oct 17, 2013 9:28 pm
Reply with quote

First step S1: I replace " "," " to ",".
Second step S2: I replace " ", " to ",".
Third step S3: I replace " ," " to ",".
Fourth step S4: i replace " " " to " ".

Also Steps shown below.


Code:
//S1 EXEC PGM=ICEMAN                                                   
//SYSOUT DD SYSOUT=*                                                   
//SORTIN DD DSN=TCL1.T.ACBSDIER.DCS20100,DISP=SHR                       
//*"600","CY",8,"3787660","000043877",14099.83,1166.96,"USD"           
/*                                                                     
//SORTOUT DD DSN=TCL1.GK.ACBSDIER.DCS20100.LEVEL1,DISP=SHR             
//SYSIN DD *                                                           
  OPTION COPY                                                           
  INREC FINDREP=(INOUT=(C'","',C','))                                   
/*                                                                     
//*****        SORT OF INPUT FILES                                 *****
//**********************************************************************
//S2 EXEC PGM=ICEMAN                                                   
//SYSOUT DD SYSOUT=*                                                   
//SORTIN DD DSN=TCL1.GK.ACBSDIER.DCS20100.LEVEL1,DISP=SHR               
/*                                                                     
//SORTOUT DD DSN=TCL1.GK.ACBSDIER.DCS20100.LEVEL2,DISP=SHR             
//SYSIN DD *                                                           
  OPTION COPY                                                           
  INREC FINDREP=(INOUT=(C'",',C','))                                   
/*                                                                     
//S3 EXEC PGM=ICEMAN                                                   
//SYSOUT DD SYSOUT=*                                                   
//SORTIN DD DSN=TCL1.GK.ACBSDIER.DCS20100.LEVEL2,DISP=SHR               
/*                                                                     
//SORTOUT DD DSN=TCL1.GK.ACBSDIER.DCS20100.LEVEL3,DISP=SHR             
//SYSIN DD *                                                           
  OPTION COPY                                                           
  INREC FINDREP=(INOUT=(C',"',C','))                                   
/*                                                                     
//*****        SORT OF INPUT FILES                                 *****
//**********************************************************************
//S4 EXEC PGM=ICEMAN                                                   
//SYSOUT DD SYSOUT=*                                                   
//SORTIN DD DSN=TCL1.GK.ACBSDIER.DCS20100.LEVEL3,DISP=SHR               
//SORTOUT DD DSN=TCL1.GK.ACBSDIER.DCS20100.LEVEL4,DISP=SHR             
//SYSIN DD *                                                           
  OPTION COPY                                                           
  INREC FINDREP=(INOUT=(C'"',C' '))                                     
**************************** Bottom of Data ****************************


Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Thu Oct 17, 2013 9:40 pm
Reply with quote

OK. You're not actually using ICETOOL.

Try:

Code:
  OPTION COPY
  INREC FINDREP=(INOUT=(C'"',C''))


That should get all the "s at once.

Although you can't use multiple FINDREP on INREC, you can use multiple IFTHEN, like IFTHEN=(WHEN=NONE, and have a FINDREP subordinate to that.

Same for OUTREC and OUTFIL.

In this case, I don't see that you need multiple FINDREPs, or multiple values to change (also possible with FINDREP, check the manual).
Back to top
View user's profile Send private message
Govardhana krishna

New User


Joined: 29 Apr 2008
Posts: 9
Location: INDIA

PostPosted: Thu Oct 17, 2013 9:57 pm
Reply with quote

Thank you very much. I got it icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
No new posts Need to split single line into two li... DFSORT/ICETOOL 7
No new posts Copying data from prev record using SORT SYNCSORT 19
No new posts Combining more 4 files with sorted or... DFSORT/ICETOOL 3
No new posts Creating a single-record file with CO... DFSORT/ICETOOL 8

Back to Top