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

I am generating a macro with double quotes in if

eg

%let TEXT=Total outstanding balance for "Rise company" is 25;

Proc print data=sashelp.cars;

title "for period the &text";

run;

i will get error

how to replace or remove this double quotes form text macro

is there any way

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

title %sysfunc(quote(for period the &text));

View solution in original post

7 REPLIES 7
data_null__
Jade | Level 19

title %sysfunc(quote(for period the &text));

santhosh
Fluorite | Level 6

i  have one problem

i am connecting to oracle and executing procedure and i am getting error

%put &syserrortext;

 

ORACE execute error: ORA-06550: line 1, column 7:PLS-00201: identifier 'PROC_CPR033_VALIDATE11' must be

       declaredORA-06550: line 1, column 7:PL/SQL: Statement ignoredORA-06512: at "DEVELOPER.CPR_RETURNS_BACK_DATE", line

       67ORA-06512: at line 1

now i want to display this syserrortext in table or in macro or export as txt

if i use this in title i am getting following error

ERROR: The function QUOTE referenced by the %SYSFUNC or %QSYSFUNC macro function has too many arguments.

is there any way

data_null__
Jade | Level 19

The commas in syserrortext are the problem.  Try this

%sysfunc(quote(%superq(syserrortext)))

notice there is NO & used with %superq.

santhosh
Fluorite | Level 6

%put &syserrortext;

 

ORACE execute error: ORA-06550: line 1, column 7:PLS-00201: identifier 'PROC_CPR033_VALIDATE11' must be

       declaredORA-06550: line 1, column 7:PL/SQL: Statement ignoredORA-06512: at "DEVELOPER.CPR_RETURNS_BACK_DATE", line

       67ORA-06512: at line 1

this double quotes is creating a problem

is there any way to remove double or single quotes from macro syserrortext

Tom
Super User Tom
Super User

Did you try what data _null_ suggested?

Why do you want to remove the quotes if your intent is to use the value?

To use as a value in a DATA step then use SYMGET and you do not need to worry about the commas or quotes.

data want;

  length syserrortext $400;

  syserrortext=symget('syserrortext');

run;

To use the value in a TITLE statement then use the QUOTE() function.


title %sysfunc(quote(%superq(syserrortext));

santhosh
Fluorite | Level 6

Thanks tom its correct

santhosh
Fluorite | Level 6

data want;

  length syserrortext $400;

  syserrortext=symget('syserrortext');

run;

using this code i am able to handle error in want table

if there is no error i am getting blank data but when i am taking count of syserrortext then i am getting count as 1

how to get 0 if no data is available

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 2776 views
  • 1 like
  • 3 in conversation