BookmarkSubscribeRSS Feed
gsnidow
Obsidian | Level 7

Greetings all.  First let me apologize for starting another thread that is related to one I started two weeks ago or so.  That thread went way off from my original question, so I thought where it ended up warranted it's own thread.  I am having difficulty using the $ebcdic. format.  There are 33 characters that $ebcdic. either returns '00' or it incorrectly translates from ascii.  I should note that when I say 'incorrectly', I mean it is not doing what I need it to do, but I am sure it is doing what it is programmed to do.  To eliminate all possibilities of import errors from our mainframe, I started with decimals 0-255, then used formats to convert them to ascii hex and ebcdic hex.  The attached code file will show what I am needing to do.  Again, I have used an array to translate to suit my needs.  My array will translate based on ebcdic code page 37, and indeed, the 33 suspect translations are as my array translates them using code page 37.  So, I have a couple of questions.

1) How can I determine which translation table $ebcdic is using to translate?  Is it using a translation table?

2) I was able to create a translation table that is stored in sasuser.profile.  Is it possible to tell $ebcdic. to use my translation table, which is the same as ebcdic code page 37.

3) The code page 37 table shown at http://en.wikipedia.org/wiki/EBCDIC_037 shows the unicode equivalents of the ebcdic code points.  I know that for ascii, decimals 0-127 represent the same characters as unicode.  But for 128-255, all bets seem to be off.  Do I need to bring unicode into the equation?

I would so much appreciate any help on this issue.  Since the end of my last thread (thank you so much Tom for your help) I have been working with our mainframe folks and other SAS users here to try to get an answer, as well as read everything I could find about translation tables and formats.  I am again at a point where I am in need of some more leads to follow.  The attached code should be straight forward.

Greg

2 REPLIES 2
Astounding
PROC Star

Greg,

Don't know if this will help, but it might be one piece of the puzzle.

Documentation for the BYTE function states that its results will vary on a PC, for 128-255.  It depends on the country of origin for the PC, since different countries use different schemes for 128+. 

Good luck.

gsnidow
Obsidian | Level 7

Astounding, there might be something to that.  Most of the translations in question are after 128, but there are a few starting with 91.  Also, I checked the ascii hex values SAS is producing using SQL Server, and the results are the same.  But, to your point, that could be because of my machine.  I'm using a HP ProBook 6550b.  Thanks for the tip.

Greg

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1363 views
  • 0 likes
  • 2 in conversation