KSharp, Thanks for the help.But I'm getting the following error:
NOTE: Line generated by the macro variable "SG".
1 '05'
-
22
SYMBOLGEN: Macro variable COND resolves to AND Customer_Segment in ('HOSPITAL')
SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been
unquoted for printing.
NOTE: Line generated by the macro variable "SG".
1 '05'
-
200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
a numeric constant, a datetime constant, a missing value, (, *, +, -, ALL, ANY,
BTRIM, CALCULATED, CASE, INPUT, PUT, SELECT, SOME, SUBSTRING, TRANSLATE, USER.
ERROR 200-322: The symbol is not recognized and will be ignored.
NOTE: Line generated by the macro variable "COND".
1 AND Customer_Segment in ('HOSPITAL')
-
22
-
200
MPRINT(OUTPUT): Create table ttt as select * from access where Sales_group = '05' AND
Customer_Segment in ('HOSPITAL');
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant,
a datetime constant, a missing value, (, -, SELECT.
ERROR 200-322: The symbol is not recognized and will be ignored.
I tried the following and it worked:
%let parms=%qsubstr(&syspbuff,2,%length(&syspbuff)-2);
%let sg=%scan(&parms,1,%str(,));
%let cond=%scan(&parms,2,%str(,));
%put parms=&parms.;
%put sg=&sg.;
%put cond=&cond.;