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 -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Tue Sep 02, 2008 12:50 am
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: 400
Location: Mumbai

PostPosted: Tue Sep 02, 2008 5:53 am
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
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

Global Moderator


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

PostPosted: Tue Sep 02, 2008 3:31 pm
Reply with quote

Your code

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

should work per the command specifications

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
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: 2481
Location: @my desk

PostPosted: Tue Sep 02, 2008 4:31 pm
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

Moderator Emeritus


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

PostPosted: Tue Sep 02, 2008 7:26 pm
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
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

Moderator Emeritus


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

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

Hello,

This previous sort topic shows how to "edit" data:
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


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