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: 310
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: 8569
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: 310
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: 8569
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: 310
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: 8569
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 Date conversion using SORT SYNCSORT 4
No new posts include cond ascii constant DFSORT/ICETOOL 4
This topic is locked: you cannot edit posts or make replies. Write Character to Hexadecimal file w... COBOL Programming 8
No new posts Date Conversion Y2T to Y2W SYNCSORT 8
No new posts XYplorer - EBCDIC to ASCII translatio... All Other Mainframe Topics 0
Search our Forums:

Back to Top