Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How can I convert from EBCDIC to ASCII format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sgaid21

New User


Joined: 12 Sep 2006
Posts: 16
Location: Canada

PostPosted: Wed Aug 08, 2007 1:01 am    Post subject: How can I convert from EBCDIC to ASCII format
Reply with quote

Hi all,

I have some Datasets needed to be converted from EBCDIC to ASCII format.

Is there any tool within JCL I can use to do so? Or any other suggestion.

Thanks.
Back to top
View user's profile Send private message

superk

Moderator Team Head


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

PostPosted: Wed Aug 08, 2007 1:07 am    Post subject: Re: How can I convert from EBCDIC to ASCII format
Reply with quote

A few ideas off the top of my head:


  • SAS (The Programming Language)
  • OCOPY (The USS utility)
  • REXX (Using the Translate Function)
  • FTP (Think about it)
  • PKZIP (The Third-Party Software)
Back to top
View user's profile Send private message
sgaid21

New User


Joined: 12 Sep 2006
Posts: 16
Location: Canada

PostPosted: Wed Aug 08, 2007 1:15 am    Post subject:
Reply with quote

I might use REXX but if you can simplified for me.

Thanks,
S.G.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Wed Aug 08, 2007 2:39 am    Post subject:
Reply with quote

Regarding the FTP option. If you connect to an FTP server and do a transfer, most default to a text transfer and will do the conversion for you. If you need to convert to ASCII on the mainframe and manipulate there, what is the acutal requirement.

Also, which EBCDIC character set are you using? I had a similar requirement and found there were quite a few different definitions.
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 Aug 08, 2007 4:04 am    Post subject:
Reply with quote

Hello,

How will the ASCII file be used?

The answer to that may help determine how the data is converted.
Back to top
View user's profile Send private message
sgaid21

New User


Joined: 12 Sep 2006
Posts: 16
Location: Canada

PostPosted: Wed Aug 08, 2007 4:14 am    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

How will the ASCII file be used?

The answer to that may help determine how the data is converted.


The ASCII file will be used in the other end - no idea.

I'll try the FTP transfer and I hope that would be it.

Thanks.
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 Aug 08, 2007 4:42 am    Post subject:
Reply with quote

Hello,

If you create your file with no packed or binary numbers, you should be in good shape.

Let us know if there are "opportunities".
Back to top
View user's profile Send private message
sgaid21

New User


Joined: 12 Sep 2006
Posts: 16
Location: Canada

PostPosted: Wed Aug 08, 2007 4:51 am    Post subject:
Reply with quote

Hello,

Yes, the file has PD and BI. That means the data will not convert correctly.

Then, what other possibilities that I can use. Is there a way I can code a COBOL pgm to handle that and if so then what is the conversion table I can use. Or what is the quickest way to achieve that.

Thanks,
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 Aug 08, 2007 5:04 am    Post subject:
Reply with quote

Hello,

If you are sending this data to a win-based platform (or UNIX) for that matter, you might want to write as quick COBOL program to read your file as it is, move all packed, binary, and zoned decimal (with an implied decimal place) numbers to fields that will contain numbers, a decimal point where applicable, and a minus sign for negative numbers.

Your fields would wind up with values like
000012345
000012345.67
03456.78-
etc. For ease of use on the target system, i'd make sure the fields were filled with zeros from the left (an easy move in cobol).

Once you have all of the fields converted to text, i would STRING all of the fields into an output area and insert a tilde "~" or a backslash "\" between each field. This is to ease use on the target - delimited files are easier to import than "fixed length" - IMHO. Make sure the length of the INTO field is long enought to handle all of the "strung" values.
Back to top
View user's profile Send private message
sgaid21

New User


Joined: 12 Sep 2006
Posts: 16
Location: Canada

PostPosted: Wed Aug 08, 2007 8:34 am    Post subject:
Reply with quote

Hi Dick,

How about this, after I convert the PD, BI, ZD into implied decimal place or text, I FTP the o/p file and in this case they will receive the good looking file in ASCII format, is that right?

Does that work?

Thanks,
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 Aug 08, 2007 5:57 pm    Post subject:
Reply with quote

Hello,

Quote:
I FTP the o/p file and in this case they will receive the good looking file in ASCII format, is that right?

Yes, the file will be readable on the target system. To make the file more easily used, i would suggest placing a delimiter character between the data fields. Nearly all of the "import" tools support delimited files. If the files come fixed format, the fields need to be "marked" during the import. Also, if delimited files are used and a data field is inserted or the length changed, it is trivial. If the fixed layout changes, it can be a pain.
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 Conversion of UTF-8 to EBCDIC muralikrishnan_new COBOL Programming 1 Tue Nov 21, 2017 5:33 pm
No new posts Can EDCICONV convert EBCDIC to ASCII... natt.sut IBM Tools 3 Fri Nov 17, 2017 8:46 pm
No new posts Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 5 Tue Oct 24, 2017 12:01 pm
No new posts Format issues using XMITIP MSGDD ssdjp1 CLIST & REXX 5 Mon Oct 23, 2017 8:47 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us