I have a shell script that brings the file from Mainframe server to Unix server. The issue is that the file which gets delivered on unix server contains the data in one single row only. I am using below script
In iconv command, IBM-1047 is for the source mainframe file which is EBCDIC encoded and ISO8859-1 is for target file which should be in ASCII encoding.
get command in above script brings the file from mainframe server to unix server but it contains data in one single row only and due to this iconv command also converts the file(having data in one single row only) into ASCII format. Please note that the mainframe file has 2 rows of data.
Can anyone please help me here ? I want that the mainframe file which gets delivered via get command should have the actual data in separate lines and not in one single line.
@Saurabh42 , can you show the resultant data from the iconv process and,
if possible a screenshot of the data on the mainframe system or at least what you want/need it to look like.
finally, show the output of file RT.CACSCMP.DISK.ABC.CMD abc.txt
Above what has already been required, I would like to know what you call mainframe? We agree its an IBM running ZOS? not an IBM middle-class box running IBM other proprietary OS...
I used to do this sort of processing from a ZOS to aix7..., now I remember some peculiar behaviour: I had in my script loaded command variables ICONV1 ICONV2... If I dont remember what was $ICONV1 ( native AIX?) I remembered ICONV2 was a version of gnu as both gave different results ( dealing with special language specific char...)
All this to say that from what I just wrote, it is going to be very difficult without having the required output, an idea of input , and what OS is the UNIX server running, then what is the iconv utility you are using as they are not all equal...
So please specify what Unix OS and version are you running, plus what iconv and version
TIA
according to EBCDIC 1047 - EverybodyWiki Bios & Wiki a LF is encoded as 0x25 and a CR as 0xd, so you could give ...CMD | sed -r 's,\x25|\xd,\n,g' > abc.txt a try. Even though that should actually be iconv's job.