View previous topic :: View next topic |
Author |
Message |
kavi Beginner
Joined: 15 Sep 2006 Posts: 64 Topics: 22
|
Posted: Fri Jan 18, 2008 7:48 am Post subject: How to convert HEX to ASCII |
|
|
Hi all,
Here is my requirement. I have a HEX file having 80 bytes lenght. I need to convert this HEX values into their corresponding ASCII values. Please how can i do this by SORT.
Thanks in advance
Kavi |
|
Back to top |
|
|
superk Advanced
Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Fri Jan 18, 2008 8:48 am Post subject: |
|
|
You'll probably need to update this post with the usual details:
1. Is the dataset FB or VB?
2. What is the RECFM/LRECL requirement for the output dataset?
3. You'll obviously need to provide the details for your EBCDIC values and what ASCII values you want them translated into.
4. Do you need to translate the entire 80-byte record? Or, only portions of it? |
|
Back to top |
|
|
Bill Dennis Advanced
Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Fri Jan 18, 2008 9:18 am Post subject: |
|
|
You can use IEBGENER to write the file to a LABEL=(,NL) tape converted to ASCII by using DCB=OPTCD=Q on the output DD. See the JCL Reference manual for restrictions. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Fri Jan 18, 2008 9:31 am Post subject: |
|
|
If you try to use NL or BLP in my shop, you'll have a host of questions to answer. _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
kavi Beginner
Joined: 15 Sep 2006 Posts: 64 Topics: 22
|
Posted: Mon Jan 21, 2008 2:55 am Post subject: |
|
|
Thanks for all your replies.
Bill Dennis
Can you please explain with an example.
superk
Its a FB file with lrecl of 80 and I need to convert all 80 Byte HEX values to ASCII. The file will be created dynamically, and it can have any hex value.
Thanks
Kavi |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Jan 21, 2008 5:44 am Post subject: |
|
|
Why don't you read the manual about IEBGENER? Why have someone else do it for you? The link is at the top of the page. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Jan 21, 2008 11:22 am Post subject: |
|
|
"hexadecimal file"? Do you mean EBCDIC?
If so, there's no standard way to translate EBCDIC to ASCII. You'd have to pick the translation table you want to use. You could then set up that table using DFSORT's ALTSEQ statement and do the translation using TRAN=ALTSEQ. For example, if your input file has RECFM=FB and LRECL=80, you could use a DFSORT job like this:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
ALTSEQ CODE=(...)
INREC BUILD=(1,80,TRAN=ALTSEQ)
/*
|
For more information on DFSORT's ALTSEQ statement, see:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.4?DT=20060615185603 _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
kavi Beginner
Joined: 15 Sep 2006 Posts: 64 Topics: 22
|
Posted: Wed Jan 23, 2008 12:12 am Post subject: |
|
|
Nic Clouston
"Why have someone else do it for you?"
It does't mean that Iam asking someone else do it for me instead iam looking for some assistance.
If everything can be done in just reading the manuals then why we are asking helps.
Frank Yaeger
I used ALTSEQ it works fine thanks.
Thanks for all your help. |
|
Back to top |
|
|
vjkumk Beginner
Joined: 28 Sep 2005 Posts: 98 Topics: 33
|
Posted: Fri Feb 22, 2008 8:30 am Post subject: |
|
|
you can check the simotime website for more details regarding hex to ascii conversion.
cheers,
vj |
|
Back to top |
|
|
|
|