BookmarkSubscribeRSS Feed
alr
Quartz | Level 8 alr
Quartz | Level 8

Hi,

I’m running SAS 9.1.3 SP 4 on z/OS (IBM Model 2827).

 

My code is:

%let a=test@test.com;

%put &a;              

 

But the output/log looks like this:

1                            

2                            

3   %let a=test@test.com;  

4   %put &a;                

testØtest.com                

 

The @ sign is translated to Ø.

 

How can I avoid this?

4 REPLIES 4
Tom
Super User Tom
Super User
Looks like you have bad EBCDIC - ASCII conversion table. You are getting '70'x instead of '7C'x. How are you connecting to the Z/OS machine? How did you create the program? Did you type it directly on the mainframe or upload from a PC or other ASCII host?
alr
Quartz | Level 8 alr
Quartz | Level 8

Thank you Tom,

I just type it directly on the mainframe. (SAS interactive on mainframe)

But in the batch (when I save the code in a sasinc file in order to call it with JCL and run it), I can see that @ have ‘80’x as HEX.

Do you know any work around for this?

Tom
Super User Tom
Super User
I don't use Mainframes anymore so I am not sure where in the process your code is getting transcoded incorrectly. You could try creating the value using hex codes. '80'X in EBCDIC is the character you are seeing. SAS normally uses ASCII codes for variables so in ASCII you would want '40'X for '@'. So if could try creating the value from a data set with CALL SYMPUTX('A','test'||'40'x||'test.com'); Or you could try using '7C'x instead.
alr
Quartz | Level 8 alr
Quartz | Level 8

Thank you Tom.

 

We run with EBCDIC 1142.

 

proc options option=encoding; run;

gives:

SAS (r) Proprietary Software Release 9.1 TS1M3

ENCODING=EBCDIC1142

Default encoding for external data

 

And according to this page http://www.longpelaexpertise.com.au/toolsCode.php and as you say the HEX code for @ should be ‘80’x

 

but when I try

 

CALL SYMPUTX('A','test'||'80'x||'test.com');

 

I still get testØtest.com

 

‘7C’x gives the same testØtest.com ???!!!

 

I think I have to contact the people responsible for our SAS installation.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 1309 views
  • 1 like
  • 2 in conversation