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.
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.
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