DATA Step, Macro, Functions and more

concatenate my Test name to format

Reply
Occasional Contributor
Posts: 7

concatenate my Test name to format

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 
Super User
Super User
Posts: 9,855

Re: concatenate my Test name to format

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.

Occasional Contributor
Posts: 7

Re: concatenate my Test name to format

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 

Super User
Super User
Posts: 9,855

Re: concatenate my Test name to format

"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.

 

Ask a Question
Discussion stats
  • 3 replies
  • 70 views
  • 0 likes
  • 2 in conversation