IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How can I convert from EBCDIC to ASCII format


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

Global Moderator


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

PostPosted: Wed Aug 08, 2007 1:07 am
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
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
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

Moderator Emeritus


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

PostPosted: Wed Aug 08, 2007 4:04 am
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
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

Moderator Emeritus


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

PostPosted: Wed Aug 08, 2007 4:42 am
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
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

Moderator Emeritus


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

PostPosted: Wed Aug 08, 2007 5:04 am
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
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

Moderator Emeritus


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

PostPosted: Wed Aug 08, 2007 5:57 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts InfoSphere OPTIM CSV ouput vs DSNTIUA... IBM Tools 3
Search our Forums:

Back to Top