BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Naveen1111
Calcite | Level 5

Hi All,

I have one question from the below mentioned code. Can anyone tell me why did we use/denote 80 x as euro and A3 with a pound and a5 with a yen. When I changed this with different value i.e(20, 90,a1) it didn't work.

I also want to know how sas can understand this in spite of mentioning euro pond and yen in the comment, as I believe sas won't read/understand when we put something in comments. As I am a beginner in sas, also guide me where can I see the documentation of the said code. 

 

 

/* Define the symbol characteristics */
symbol1 interpol=join color=vibg height=14pt font='Arial' value='80'x; /* Euro */
symbol2 interpol=join color=mob height=14pt font='Arial' value='A3'x; /* Pound */
symbol3 interpol=join color=depk height=14pt font='Arial' value='A5'x; /* Yen */

 

 

 

data exchange;
input YearQuarter mmddyy10. Euro Pound Yen;
datalines;
1/1/2008 0.00 0.00 0.00
4/1/2008 -4.25 0.30 -0.90
7/1/2008 -0.50 4.48 2.18
10/1/2008 13.69 26.04 -8.68
1/1/2009 14.53 37.62 -11.30
4/1/2009 9.97 28.04 -7.53
7/1/2009 4.76 20.51 -11.13
10/1/2009 1.36 21.17 -14.80
1/1/2010 8.09 26.80 -13.92
4/1/2010 17.51 32.66 -12.57
7/1/2010 16.06 27.66 -18.51
10/1/2010 10.09 25.06 -21.67
1/1/2011 9.54 23.56 -21.98
4/1/2011 4.04 21.24 -22.57
7/1/2011 5.76 22.75 -26.19
10/1/2011 10.98 25.77 -26.64
1/1/2012 14.20 25.93 -24.79
4/1/2012 16.53 24.94 -23.97
7/1/2012 19.66 25.23 -25.37
10/1/2012 15.41 23.17 -23.00
1/1/2013 13.35 27.40 -12.51
;
run;

/* Define the titles */
title1 "Currency Percent Change Against the U.S. Dollar";
title2 "Quarterly Data - Baseline 1/1/2008";

/* Define the axis characteristics */
axis1 label=none order=('01Jan2008'd to '01Jan2013'd by year) offset=(1,1)pct;
axis2 label=(angle=90 "Percent Change") minor=(n=1);

/* Define the symbol characteristics */
symbol1 interpol=join color=vibg height=14pt font='Arial' value='80'x; /* Euro */
symbol2 interpol=join color=mob height=14pt font='Arial' value='A3'x; /* Pound */
symbol3 interpol=join color=depk height=14pt font='Arial' value='A5'x; /* Yen */

/* Define the legend */
legend1 repeat=1 shape=symbol(5,2.5) label= noneframe;

/* Create the graph */
proc gplot data=exchange;
plot (Euro Pound Yen)*YearQuarter / overlay legend=legend1
haxis=axis1 vaxis=axis2;
format YearQuarter year4.;
run;
quit;

1 ACCEPTED SOLUTION

Accepted Solutions
biopharma
Quartz | Level 8

The VALUEs specified in the SYMBOL statement are hexadecimal. Those specific values translate to Euro, pound and Yen. If you change '80'x to something else, it will result in something different from EURO. This is expected behavior. It looks like you are asking about the code in this 

https://support.sas.com/kb/50/993.html

 

SGPLOT is the upgraded version as @ballardw  has mentioned. I would use that too.

View solution in original post

3 REPLIES 3
ballardw
Super User

"Didn't work" is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the <> to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the <> icon or attached as text to show exactly what you have and that we can test code against.

 

 

The "value" is going to be font dependent to some extent. So the comment is just there for later users, such as you, know the intent of what the value displayed should be. The hex value you use should be the numeric code value for a given character in a given font.

So if you change the font, or remove the font from the symbol statement falling back on the current default for your style, you can get different characters.

The plot statement:

plot (Euro Pound Yen)*YearQuarter / overlay legend=legend1

maps the first variable, Euro to use the Symbol1 statement, Pound to use the Symbol2 statement and Yen to use the symbol3 statement. Order of appearance is the order of symbol use. Change the order of the variables and confuse yourself with the results.

 

Since you don't show what you may have changed the code to I can't say what you might have expected. What are you attempting to do?

 

You may also want to consider moving to Proc SGPLOT as that is where SAS has been making improvements, such as around 29 different plots in SGPLOT (one proc instead of Gplot and Gchart) versus 2 in Gplot plus the 4 or 5 in Gchart, plus many of the different types of graphs can be overlaid.

biopharma
Quartz | Level 8

The VALUEs specified in the SYMBOL statement are hexadecimal. Those specific values translate to Euro, pound and Yen. If you change '80'x to something else, it will result in something different from EURO. This is expected behavior. It looks like you are asking about the code in this 

https://support.sas.com/kb/50/993.html

 

SGPLOT is the upgraded version as @ballardw  has mentioned. I would use that too.

Naveen1111
Calcite | Level 5

many many thanks for ur support! 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 853 views
  • 1 like
  • 3 in conversation