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 -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
amit039

New User


Joined: 08 Jul 2008
Posts: 7
Location: Chennai

PostPosted: Mon Sep 01, 2008 2:24 pm    Post subject: EBCDIC to ASCII conversion using OCOPY
Reply with quote

Hi,
This is my first post in this forum.

I'm trying to use the IKJEFT01 OCOPY option in order to convert an EBCDIC data to ASCII. I'm using the following OCOPY :

OCOPY INDD(INPUT) OUTDD(OUTPUT) TEXT CONVERT('SYS1.MYLIB(MYTAB)') TO1047

I also tried:
OCOPY INDD(INPUT) OUTDD(OUTPUT) TEXT CONVERT((BPXFX311)) FROM1047

However I'm getting an S0000 U0102 abend in both cases. I think they may be due to the table aliases/table names used.
How can I get rid of this abend & use the OCOPY successfully ? icon_rolleyes.gif icon_confused.gif
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 02, 2008 12:50 am    Post subject:
Reply with quote

Hello,

If you convert the file to ASCII on the mainframe, how will it be used?
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Tue Sep 02, 2008 5:53 am    Post subject: Reply to: EBCDIC to ASCII conversion using OCOPY
Reply with quote

I've never had luck with OCOPY and translation. iconv works well though for this but it is an extra step
Back to top
View user's profile Send private message
amit039

New User


Joined: 08 Jul 2008
Posts: 7
Location: Chennai

PostPosted: Tue Sep 02, 2008 3:00 pm    Post subject:
Reply with quote

Hi all,
The data is supposed to be to a database used by java front end programs. However the EBCDIC to ASCII conversion is taken care by FTP.

However I misunderstood the format of the input:oops:. It is in some kind of binary format & I used DFSORT to format. I used the following in SYSIN part to convert it...

OPTION COPY
OUTREC FIELDS=(1,43,
44,4,BI,TO=ZD,LENGTH=8,
48,63,
111,4,BI,TO=ZD,LENGTH=8,
115,52,
167,4,BI,TO=ZD,LENGTH=8,
171,4,BI,TO=ZD,LENGTH=8,
175,65,
240,3,PD,TO=ZD,LENGTH=5,
243,195)

However I'm still getting some unwanted characters in the output..... icon_exclaim.gif
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Sep 02, 2008 3:31 pm    Post subject: Reply to: EBCDIC to ASCII conversion using OCOPY
Reply with quote

Your code

OCOPY INDD(INPUT) OUTDD(OUTPUT) TEXT CONVERT((BPXFX311)) FROM1047

should work per the command specifications

http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.bpxa400/ocopm.htm
Back to top
View user's profile Send private message
amit039

New User


Joined: 08 Jul 2008
Posts: 7
Location: Chennai

PostPosted: Tue Sep 02, 2008 4:08 pm    Post subject:
Reply with quote

The problem was few fields were in binary & packed decimals..
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Tue Sep 02, 2008 4:31 pm    Post subject:
Reply with quote

Quote:
However I'm still getting some unwanted characters in the output


Are u trying to convert binary/packed into displayable format? What output you r getting while using the card mentioned above and what's the expected output?

Thanks,
Arun
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 02, 2008 7:26 pm    Post subject:
Reply with quote

Hello,

If you are going to transfer the file to a windows or unix system, you will probably not be able to use zoned-decimal - the ascii systems do not use the same zoned-decimal the mainframe does.

You need to convert the packed and/or binary numerics to an edited format that would include a physical decimal-point (if there is one) and the minus sign "-" for negative numbers (i.e. 123.45-).
Back to top
View user's profile Send private message
amit039

New User


Joined: 08 Jul 2008
Posts: 7
Location: Chennai

PostPosted: Tue Sep 02, 2008 9:09 pm    Post subject:
Reply with quote

Hi all,

I'm able to transform the data format I mentioned to zoned decimal display using the code I mentioned. Though as the front end testing has not yet started I'm not yet sure whether the correct format is received there.
Dick,you mentioned about converting the binary & packed numerics to some edited format. Can you please specify which format I should switch to. Also I'm very new to mainframe programming. It would be very helpful if you leave a hint how I should proceed with it... icon_question.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 03, 2008 12:35 am    Post subject:
Reply with quote

Hello,

This previous sort topic shows how to "edit" data:
http://ibmmainframes.com/viewtopic.php?t=33127

Look at Frank's solution near the bottom of the topic.

The "edited" output should work in your pc application.
Back to top
View user's profile Send private message
amit039

New User


Joined: 08 Jul 2008
Posts: 7
Location: Chennai

PostPosted: Thu Sep 04, 2008 12:03 pm    Post subject:
Reply with quote

Thanks Dick..I'll try it out... icon_smile.gif
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 -> JCL & VSAM 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 EBCDIC to ASCII conversion using OCOPY mistah kurtz All Other Mainframe Topics 5 Tue Sep 06, 2016 2:26 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


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