Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

EBCDIC to ASCII conversion using OCOPY

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
mistah kurtz

Active User


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

PostPosted: Tue Sep 06, 2016 2:26 pm    Post subject: EBCDIC to ASCII conversion using OCOPY
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: 7913
Location: Bellevue, IA

PostPosted: Tue Sep 06, 2016 4:33 pm    Post subject:
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: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Sep 06, 2016 5:10 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Tue Sep 06, 2016 5:40 pm    Post subject:
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: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Sep 06, 2016 5:59 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Tue Sep 06, 2016 6:39 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
No new posts Converting EBCDIC to Unicode (TimeStamp) muralikrishnan_new COBOL Programming 2 Mon Jul 25, 2016 10:42 pm
No new posts Comparex utility to Syncsort conversion mistah kurtz SYNCSORT 11 Fri Jul 22, 2016 1:53 pm
No new posts changing z/os unicode conversion service meykh2014 All Other Mainframe Topics 0 Tue Jul 12, 2016 10:49 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us