View previous topic :: View next topic
|
Author |
Message |
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
I want to replace all , in record with :
Can anyone help me in this.
Thanks |
|
Back to top |
|
|
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
to make my requiremnet more clear
In a record where ever ther is a ',' I want to replace it with ':'
Thanks |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Any chance that you might mention which product / tool that may be on the list of those to use ? |
|
Back to top |
|
|
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
Ohh I m really sorry for that Expat.
I want the above requirement to be done in Easytrieve.
Instead of checking each charected manually do we have any VERB or STRING Comand which can perform the replace activity. |
|
Back to top |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
Hi dp33770,
If I am not mistaken, a similar topic was posted by you in the cobol forum. Your requirement was to replace ',' with ':' but only b/w quotes(").
I don't know, if its exactly the same thing you want to do in easytrieve.
As far as I know there is no INSPECT verb in easytrieve. You need to achieve this via some logical coding, character by character checking would be involved.
If its a straight forward conversion ,you can try using function FINDREP of DFSort.
Code: |
//SYSIN DD *
OPTION COPY
INREC FINDREP=(INOUT=(C'Max',C'Maximum',C'Min',C'Minimum')) |
Please let me know if this helps, or you only need ot code in easytrieve.
Thanks,
-Kapil. |
|
Back to top |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
You may find this link useful, It has the complete easytrieve code for your problem.
Try finding the below question in the given URL: Find and replace a string in easytrieve
Q: I need to search a string for a specific character, and if the character is found, replace the found character with another character.
Hope you find it useful.
Thanks,
-Kapil. |
|
Back to top |
|
|
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
Hi kapil,
First of all thanks for reply.
Yes, I have posted similar kind of requirement in COBOL.
But here the requiremnet is simple. All I need to do is convert all ','to ':'
My I/P : 1020 RAM PRASAD 12/2,mahalaxmi aprt,hyd 3333
my Req:
STEP 1 : convert all ',' to ':'
1020 RAM PRASAD 12/2:mahalaxmi aprt:hyd 3333
STEP 2 : Fill in Fillers (',') in between fields to create a .CSV file
1020, RAM PRASAD, 12/2:mahalaxmi aprt:hyd, 3333
STEP 3 : The .CSV file will have ':' in its address field. Is there any way where I can again convert the ':' to ','. This has to be done automatically as I cant do it manually becoz this files is being FTPd after the job completes. I cant change the ':' to ',' before converting to .CSV also because this will create problem while creating .CSV
If you have any other suggestion where I can have ',' and still create .CSV then pls suggest. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Instead of using commas to separate fields use tabs (x'05') they work just fine. |
|
Back to top |
|
|
|