View previous topic :: View next topic
|
Author |
Message |
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
I'm using the OCOPY command to to convert an EBCDIC data to ASCII using the following OCOPY command:
Code: |
OCOPY INDD(INPUT) OUTDD(OUTPUT) TEXT CONVERT((BPXFX311)) FROM1047 |
The above command uses the CCSID 1047 for conversion.
I want to know if there are any utilities/commands to convert the data using other CCSIDs tables EBCDIC CCSID 37 and EBCDIC CCSID 500.
Basically we want to capture the difference in code points between these three tables. IBM has documented these differences here.
I want to know if we can validate the differences by running any utilities in Mainframe. Is there any way to find what is the defualt CCSID table used for conversion from EBCDIC to ASCII.
Thanks
K. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Research iconv in the UNIX System Services Commands manual. Since defaults depend upon your site, ask your site support group for that information. |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Thanks Robert. I found the iconv command.
What I understood from the above link that it will convert the characters set from one code set to another.
I have created a file in mainframe with 256 byte ( from X'00' to X'FF'). And the output should be converted to ASCII using the code table: 1047, 037 and 500.
So what should I do:
1. FTP the file from Mainframe to UNIX in binary mode.
2. Then to convert it into ASCII, I should use the following command in UNIX:
Code: |
iconv –t IBM-1047 EBCDIC.DATA > ASCII.1047.DATA |
Is this the correct approach. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
For consistency, use
Code: |
iconv -f <from type> -t <to type> <source file> ><target file> |
|
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Quote: |
For consistency, use
Code: |
iconv -f <from type> -t <to type> <source file> ><target file> |
|
Thanks Robert. I'm using the above command and it is working. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Glad to hear it is working. |
|
Back to top |
|
|
|