BookmarkSubscribeRSS Feed
_user
Calcite | Level 5

Hello all , 

I am working on a graph and I formatting Visit variable (numeric )  something like this 
 
proc format ; 
  Value  custom_visit ; 
0 = "&out._Visit1"
1 = "&out._Visit2" 
2 = "&out._Visit3" 
3 = "&out._Visit4" 
 
and using it as 
data test ; 
set final ; 
format   visit2  custom_visit. ; 
run; 
 
&out.   would resolve to Test name . This is working fine for my need .
My problem is that I can't have proc format within the table program , but it has to be in a one central  program . For that &out. can't be used as that is ran way before program . Is there a way to concatenate my Test name to format without changing the Numerical nature of the Visit2 ( as I need it for sorting the order ) 
Thanks 
kumar 
3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Then you need to move the code which creates out macro variable to the main program also??

 

More to the point what is this "&out._visit1" anyways?  Looks like you are trying to merge two variables which is a really bad idea.  Keep visit as a visit variable, then put this "&out." in another variable.

_user
Calcite | Level 5

Well moving my graph program to formats program is not feasible .  Regarding your question 

 

More to the point what is this "&out._visit1" anyways? 

 

I am grading my visit as per order needed on X-axis   and using the Numerical value . Then using the format of the Visit2  as the Label of Tick mark 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

"Well moving my graph program to formats program is not feasible ." - I am not talking about moving your graph program anywhere, I am talking about moving the code which creates the Out macro variable to the format program, i.e. define the macro before it is used.

 

"I am grading my visit as per order needed on X-axis   and using the Numerical value . Then using the format of the Visit2  as the Label of Tick mark " - possible a mis-understanding here.  The value in the dataset should be numeric, so you get the correct ordering, then you have the formatted data in the output per the format.

 

Its really hard to follow what you want.  As a note, for lab graph outputs, normally it would look something like, visit (i.e. visit 1, visit 2 etc.) on the xaxis, value on the y axis, and a sub-header showing the parameter, unit, gender, normal range etc.  So have one graph per by group so the axis ranges are smaller and easier to see points.

 

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
  • 3 replies
  • 776 views
  • 0 likes
  • 2 in conversation