Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Remove Quotes using single Sort step?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Remove Quotes using single Sort step?
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Thu Oct 17, 2013 9:16 pm    Post subject: Reply to: Remove Quotes using single Sort step?
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    Post subject: Reply to: Remove Quotes using single Sort step?
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Thu Oct 17, 2013 9:40 pm    Post subject: Reply to: Remove Quotes using single Sort step?
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    Post subject: Reply to: Remove Quotes using single Sort step?
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    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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us