BookmarkSubscribeRSS Feed
Jaheuk
Obsidian | Level 7

what's wrong in this code??

I want to print label in bold, variables as normal . . .

For _C1_ I already tried _COL_  or _ROW_

 

COMPUTE before _page_  ;                                  
call define(_C1_,'style','style={font_weight=bold   }');  
   %if &VARI4. EQ 02 %THEN  line @1 'Nom:'   ;            
                     %ELSE  line @1 'Naam:'  ;;           
call define(_C1_,'style','style={font_weight=normal }');  
               line @1      naam    $50.   ;              
call define(_C1_,'style','style={font_weight=bold   }');  
   %if &VARI4. EQ 02 %THEN  line @1 'Agence:' ;           
                     %ELSE  line @1 'Agentschap:' ;;      
call define(_C1_,'style','style={font_weight=normal }');  
               line @1      aorg_cd $5.  ;                

3 REPLIES 3
ballardw
Super User

Without data, the complete code and the value(s) of the macro variables it is pretty hard to tell what may or may not be going on.

 

Do you actually have multiple call defines for the same column or is that examples of what you have tried?

Cynthia_sas
SAS Super FREQ
If you are using CALL DEFINE with absolute column numbers the absolute column numbers (just like variable names) must be quoted:
call define ('_c1_', ....) or
call define ('age',.....)

So I would start there. Without seeing more of your code, I'm not sure what you are trying to accomplish. But nothing will work until you quote the first argument. The only argument values that can be unquoted are _COL_ and _ROW_.

cynthia
Ksharp
Super User

You can conditional execute LINE in that way.

Only way to that is $varying200.  like:

 

 

if x=1 then do;want='xxxx'; len=0; end;

 else do;want='yyyyy'; len=200;end;

 

line want $varying200. len ;

 

.......

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 2191 views
  • 0 likes
  • 4 in conversation