BookmarkSubscribeRSS Feed
YannRC
Fluorite | Level 6

Hello, i work on Viya 4 with sas Studio and flow.

Before i work with SQL Query. It's very clear for me with SQL. You have ton possibilities :

 

LEFT JOIN Table2 on Table1.Var = Table2.var 

where varX .... and VarX.....

 

Or LEFT JOIN Table2 on Table1.Var = Table2.var and varX= .... and VarX=.....

 And the result of these 2 queries are not equal. 

 

In SAS STUDIO, i'ts easy for me to to the second one. But, for the first on, i don't manage to do it. Perhaps, i can use the expression generator but i don't know how to write it. 

Can you help me?

1 REPLY 1
Patrick
Opal | Level 21

Using a current Viya 4 release I could generate the following code:

PROC SQL;
   CREATE TABLE WORK.'result'n AS
   SELECT 
      t1.'Name'n,
      t1.Sex,
      t1.Age,
      t1.Height,
      t1.Weight
   FROM
      SASHELP.class t1
         INNER JOIN SASHELP.class t2 ON (t1.'Name'n = t2.'Name'n)
   WHERE
      UPPER(t2.Sex) = 'F'
   ;
QUIT;
RUN;

Here the flow:

Patrick_0-1704077896725.png

The where clause is based on the filter condition

Patrick_1-1704077967893.png

 

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 218 views
  • 0 likes
  • 2 in conversation