Desktop productivity for business analysts and programmers

store a one row's value of table in one macro variable

Reply
N/A
Posts: 0

store a one row's value of table in one macro variable

Hi,
using one proc sql procedure how can i store value of all columns for one row in one macro variable.

thanks in adv
N/A
Posts: 0

Re: store a one row's value of table in one macro variable

hi,

try this :

%macro macro1();
PROC SQL;
select var1, var 2, var3
INTO : liste_var1 separated BY "|",
: liste_var2 separated BY "|",
: liste_var3 separated BY "|"
from mytable
where ...;
QUIT;

%DO i=1 %TO &sqlobs;
%LET var1=%SCAN (&liste_var1, &i, "|");
%LET var2=%SCAN (&liste_var2, &i, "|");
%LET var3=%SCAN (&liste_var3, &i, "|");

%PUT var1 : &var1;
%PUT var2 : &var2;
%PUT var3 : &var3;

%END;
%MEND;
%macro1;
Ask a Question
Discussion stats
  • 1 reply
  • 79 views
  • 0 likes
  • 1 in conversation