IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

EBCDIC to ASCII conversion using OCOPY


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
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

PostPosted: Tue Sep 06, 2016 2:26 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 06, 2016 4:33 pm
Reply with quote

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
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Sep 06, 2016 5:10 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 06, 2016 5:40 pm
Reply with quote

For consistency, use
Code:
 iconv -f <from type> -t <to type> <source file> ><target file>
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Sep 06, 2016 5:59 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 06, 2016 6:39 pm
Reply with quote

Glad to hear it is working.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts SMF Record Date conversion failing CLIST & REXX 1
Search our Forums:

Back to Top