BookmarkSubscribeRSS Feed
AndrewHowell
Moderator

Thought I was ok with pass-thru SQL, but trying to understand:

  • The WEEKDAYCD='' WITH UR clause? (Presumably some DB2-specific syntax I haven't seen before)
  • What the X(DT) does? (Is this passed-through, so DB2-specific? Or a SAS function? Is it an SQL variant of the 'X' command?)

Thanks.

PROC SQL;
  CONNECT TO DB2(SSID=DSN);
  CREATE TABLE MYWORK AS SELECT * FROM CONNECTION TO DB2
    (SELECT MAX(BIRTH_DT)
      FROM CUST.CALENDAR
      WHERE BIRTH_DT < CURRENT DATE
      AND WEEKDAYCD='' WITH UR)X(DT); 
DISCONNECT FROM DB2;
QUIT;
1 REPLY 1
Patrick
Opal | Level 21

The code portion within the connect to is DB2 syntax and you will need to consult DB2 documentation and forums with detail questions.

Patrick_0-1677044206797.png

It's long ago that I've used DB2. 

WITH UR is for Uncommited Read (dirty reading). It's the fastest way to read data in DB2 because it doesn't control and synchronize with any update, insert or delete that might happen at the same time. Using UR is very o.k. if that's some reporting data base where you can be sure that the updates happen at a time where your queries won't run.

 

This bit looks "suspicious"  Patrick_1-1677044520397.png 

but then eventually totally o.k. with DB2 SQL.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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