I am having a file with say n fields of which I have a field with a single alphabetic character. In the output file, I have to replace this alphabetic character with the corresponding number and with all the other fields remaining same. Could you please help me in doing this?
Moreover, my input file has millions of records. Whether it is good to do the above task using sort or COBOL program and which is efficient?
If it is a single replacement for ex:whether it is "a" ,"b" or "c" you are going to replace by it one number say "5" then you can use sort with OUTREC option.
If it is a replacement of different numbers for different alphabets then COBOL is preferable.
In case of efficiency test both(COBOL and Sort) and see which consumes less CPU time or elapsed time.
It is like replacing different alphabets with different numbers.
I would like to know whether this can be done by Syncsort. If so, could you let me know how to do that?
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
kbmkris wrote:
Hi,
I am having a file with say n fields of which I have a field with a single alphabetic character.
Bala
Bala,
Please let me know,
1. Is the file FB or VB ?
2. Do you know the position of that single alphabetic character.
3. Character position is static or varies.
I have to do the same thing in a FB file and in a VB file also. Yes, I know the position of the character i want to change and the character will vary.
For e.g.
in my input file, if position 4 is
'C' then i have to change it to '1'.
'A' then to '2'.
'D' then to '3' like that.
I am not sure how to formulate the corresponding hexcode for the alphabets. Please let me know how to find the corresponding hexcode for alphabets and numbers?
I went on checking with the previous Syncsort related posts in the forum and from that i came to know that some of the commands available in DFSORT will work in SYNCSORT also. I tried and it is working.
i have to do that based on some condition, say, if my position 7 and 8 of my input file contains TT and the character is C at position 9, i have to replace it to 1. Similarly i have to do for 8 conditions. So i have totally 8 ifthen in my sortcard. The full sortcard i used is
My input file contains 90000000 records. I want to know what i have to use. I have a COBOL program to do the same without sorted output and this JCL. Which is efficient? Could you please suggest me?