Convert a string from ASCII to EBCDIC
I have some text files in EBCDIC that I want to add data to in EBCDIC.
I know I can use the dd commmand if I want to translate all the files from EBCDIC to ASCII, update it in ASCII, then convert it all back to EBCDIC. But I don't wish to do that in this case because many of the files have embedded binary data. Right now I'm doing the following in a bash shell script to append a line in ASCII to $outfile (the output file): Code:
echo './ ADD NAME='${1#./} >> "$outfile" Any ideas? |
Whoa. That looks like you are building IEBUPDTE input.
Are we to presume you are doing this in zLinux as you don't seem to be concerned with little-endian <-> big-endian issues ?. |
Yes, I am building IEBUPDTE input for an MVS 3.8J system running under the Hercules emulator on my home PC. I'm concatenating the contents of thousands of individual files on my PC into one file with an IEBUPDTE ADD statement in front of each one. I'm not concerned with little-endian vs big-endian issues since the data came from a big-endian system and is going back to one. It was downloaded as a binary file, so nothing has been translated or reordered.
I've thought of a way to do this, but it is a bit of a kludge. I'll be back with an update shortly. Edit: This appears to be giving me the result I was after. But it involves multiple file creation for each conversion, so it seems inefficient. Code:
echo './ ADD NAME='${1#./} > tmp1 |
Have you asked on the Yahoo Herc list ?. Used to be quite active, and all the devs are (were) subscribers.
|
That didn't occur to me, but it's a good idea. I'll do that.
|
All times are GMT -5. The time now is 07:14 AM. |