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!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 360 views
  • 2 likes
  • 1 in conversation