proc format library=work; value $Serving 'RN' = 'Nadal' 'RF' = 'Federer' 'ND' = 'Djokovic' 'JI' = 'Isner' ; run ; *Lets combine the four datasets ; data goats_isner ; set isner_serve rafa_serve fed_serve djoker_serve ; format Serving $Serving. ; run ; *Compare the four rallylen in one chart-fix format! ; proc sgpanel data=goats_isner ; panelby year ; histogram rallylen / group=serving dataskin=matte transparency=0.5 ; label rallylen = "Rally Length" ; keylegend / valueattrs = (Size=8) ; title "Rally Length on Serve" ; run ;
My code is above with some output of the data below along with the generated plot. I got marked for spam but I am genuinely stuck on this. The output is cutting short on the legend labels to 4 characters but it reads in fine using the format I created so I am not sure why that is happening. I get "fede" instead of the entire "Federer" as I coded in the plot but my dataset reads it correctly So I am not sure why this is the case.
Am a newbie here so I apologize for any lack of clarity in my post
I am unable to open your attachments. I don't know if you did something wrong or my firewall is blocking them.
/*moved the format $seving on serving variable from data step to proc sgpanel*/
proc format library=work; value $Serving 'RN' = 'Nadal' 'RF' = 'Federer' 'ND' = 'Djokovic' 'JI' = 'Isner' ; run ; *Lets combine the four datasets ; data goats_isner ; set isner_serve rafa_serve fed_serve djoker_serve ; run ; *Compare the four rallylen in one chart-fix format! ; proc sgpanel data=goats_isner ; panelby year ; histogram rallylen / group=serving dataskin=matte transparency=0.5 ; label rallylen = "Rally Length" ; keylegend / valueattrs = (Size=8) ;
format serving $serving.; title "Rally Length on Serve" ; run ;
Thanks Jag, I tried that earlier and just now and it still yields the same result unfortunately so it doesnt work
I am unable to open your attachments. I don't know if you did something wrong or my firewall is blocking them.
Plot
Part of dataset GOATS_ISNER
Hope this helps, sorry about that they are working for me
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.