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?)
CONNECT TO DB2(SSID=DSN);
CREATE TABLE MYWORK AS SELECT * FROM CONNECTION TO DB2
WHERE BIRTH_DT < CURRENT DATE
AND WEEKDAYCD='' WITH UR)X(DT);
DISCONNECT FROM DB2;
The code portion within the connect to is DB2 syntax and you will need to consult DB2 documentation and forums with detail questions.
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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.