View previous topic :: View next topic
|
Author |
Message |
sgaid21
New User
Joined: 12 Sep 2006 Posts: 16 Location: Canada
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
sgaid21
New User
Joined: 12 Sep 2006 Posts: 16 Location: Canada
|
|
|
|
I might use REXX but if you can simplified for me.
Thanks,
S.G. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
How will the ASCII file be used?
The answer to that may help determine how the data is converted. |
|
Back to top |
|
|
sgaid21
New User
Joined: 12 Sep 2006 Posts: 16 Location: Canada
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sgaid21
New User
Joined: 12 Sep 2006 Posts: 16 Location: Canada
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sgaid21
New User
Joined: 12 Sep 2006 Posts: 16 Location: Canada
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|