Is there any command to eliminate Header and footer from EBCDIC file
Well, the general example would be:
sed '1d' file > file1 && sed '$d' file1 > NoHeaderAndFooter
but in your case it's EBCDIC file, so it's not a simple text file?
If it's the case of removing the first 24 bytes, please elaborate further.
If you're on a system where all of the data is in EBCDIC, your sed commands (or the single command:
sed -e '1d' -e '$d' file > NoHeadAndFooter
which would be faster) should work just fine.
Otherwise use dd or iconv to convert file from EBCDIC to your system's native codeset and then run your sed command(s) on the converted file.
I am on AIX system and the file has been pushed to this from Mainframe
Please advise how can I proceed in this case
I suggested using dd or iconv . Did you try either of them? Is the data from your mainframe in fixed length records. If so use something like:
dd if=YourInputFile conv=ascii cbs=FixedLengthRecordSize
If not, use something like:
iconv -f fromcode YourInputFile
where fromcode is a code chosen from the output of the command:
iconv -l
for an EBCDIC codeset.