BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Santt0sh
Lapis Lazuli | Level 10

Hi All,

 

I am not sure if this can be done. Kindly suggest me on this. I am trying to create a macro variable in a Pass thru.

 

RSUBMIT;

proc sql noerrorstop;
connect to teradata (user="xxxxxxxxxx" PASS="xxxxxxxxx" TID=xxxxxxxx mode=teradata);
execute(
SELECT COUNT( DISTINCT  a_DT) INTO:a_DT
FROM xxxxxa1.xxxxxdays;
) by Teradata;
DISCONNECT FROM teradata;
QUIT;

ENDRSUBMIT;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Santt0sh
Lapis Lazuli | Level 10
Hi All,

Thank you !!
I have found a way to create the Macro variables.
RSUBMIT;
libname lib1 teradata server='xxxxxxxxxx.com' schema='ddddcccccvvvvv3' user="********" password="******";
proc sql noerrorstop;
connect to teradata (user="xxxxxxxxxx" PASS="xxxxxxxxx" TID=xxxxxxxx mode=teradata);
execute(
/*--------------ST DATE---------------*/
create table lib1.xxxxxTdays as (
SELECT distinct a_DT as a_DT
FROM xxxxxa1.xxxxxdays;
)with data
) by Teradata;
DISCONNECT FROM teradata;
QUIT;
proc sql noprint;
select MIN(a_DT ) into:STrDATE from lib1.xxxxxTdays;
quit;
%SYSRPUT STrDATE= &STrDATE.;
ENDRSUBMIT;



Thank you!

View solution in original post

1 REPLY 1
Santt0sh
Lapis Lazuli | Level 10
Hi All,

Thank you !!
I have found a way to create the Macro variables.
RSUBMIT;
libname lib1 teradata server='xxxxxxxxxx.com' schema='ddddcccccvvvvv3' user="********" password="******";
proc sql noerrorstop;
connect to teradata (user="xxxxxxxxxx" PASS="xxxxxxxxx" TID=xxxxxxxx mode=teradata);
execute(
/*--------------ST DATE---------------*/
create table lib1.xxxxxTdays as (
SELECT distinct a_DT as a_DT
FROM xxxxxa1.xxxxxdays;
)with data
) by Teradata;
DISCONNECT FROM teradata;
QUIT;
proc sql noprint;
select MIN(a_DT ) into:STrDATE from lib1.xxxxxTdays;
quit;
%SYSRPUT STrDATE= &STrDATE.;
ENDRSUBMIT;



Thank you!

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

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

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 1329 views
  • 2 likes
  • 1 in conversation