MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to convert HEX to ASCII

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
kavi
Beginner


Joined: 15 Sep 2006
Posts: 64
Topics: 22

PostPosted: Fri Jan 18, 2008 7:48 am    Post subject: How to convert HEX to ASCII Reply with quote

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
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Fri Jan 18, 2008 8:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Fri Jan 18, 2008 9:18 am    Post subject: Reply with quote

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
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Fri Jan 18, 2008 9:31 am    Post subject: Reply with quote

If you try to use NL or BLP in my shop, you'll have a host of questions to answer. Rolling Eyes
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
kavi
Beginner


Joined: 15 Sep 2006
Posts: 64
Topics: 22

PostPosted: Mon Jan 21, 2008 2:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Jan 21, 2008 5:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Jan 21, 2008 11:22 am    Post subject: Reply with quote

"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
View user's profile Send private message Send e-mail Visit poster's website
kavi
Beginner


Joined: 15 Sep 2006
Posts: 64
Topics: 22

PostPosted: Wed Jan 23, 2008 12:12 am    Post subject: Reply with quote

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
View user's profile Send private message
vjkumk
Beginner


Joined: 28 Sep 2005
Posts: 98
Topics: 33

PostPosted: Fri Feb 22, 2008 8:30 am    Post subject: Reply with quote

you can check the simotime website for more details regarding hex to ascii conversion.

cheers,
vj
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group