Desktop productivity for business analysts and programmers

run selected code in Proc SQL

Reply
New Contributor
Posts: 4

run selected code in Proc SQL

In PC SAS, under one PROC SQL ... QUIT, we can select a particular set of codes and execute it, then do the same thing for another selected code, and etc.. But it looks this feature does not work in SAS EG, we have to run the entire Proc SQL, which makes the code testing process a little bit difficult, especially when it involves Teradata volatile table for instance.

Is there an option in SAS EG to turn this PC SAS feature on?

 

Super User
Posts: 8,069

Re: run selected code in Proc SQL

No. Since EG sends "magic code" that is designed to clean up after any mistake, it also ends proc sql with quit;

To selectively run individual SQL steps, you have to wrap them into individual proc sql calls.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 4

Re: run selected code in Proc SQL

Posted in reply to KurtBremser

that's bad. The problem is whenever we hit the quit, the volatile table will be gone, so I have no way to bring it into next proc sql. Hopefully SAS will add that feature into its future version of SAS EG. 

Thanks

Super User
Posts: 20,236

Re: run selected code in Proc SQL

That actually sounds like something you may also be able to fix on the Teradata side, can you get your volatile tables to basically not be volatile and exist past a single session.  

 

 

New Contributor
Posts: 4

Re: run selected code in Proc SQL

figured it out. Actually I have to set my v-table as global by using the option "connection=global" in proc sql, then the v-table can be used in separated proc sql. 

PROC Star
Posts: 331

Re: run selected code in Proc SQL

one more thing you can use your volatile table in SAS in datastep or implicit pass through by using dbmstemp =yes. see the link below for more details

http://documentation.sas.com/?docsetId=acreldb&docsetTarget=p0he4t6yjfmkhpn16qrf0cdhllu6.htm&docsetV...

 

PROC Star
Posts: 331

Re: run selected code in Proc SQL

Are you using implicit pass through or explicit through for accessing volatile table? if it is explicit pass through run the queries in sql assistant and then all u need to do is wrap work execute and by teradata at the end.

 

 

New Contributor
Posts: 4

Re: run selected code in Proc SQL

absolutely it won't work without "dbmstemp=yes", I am using the explicit through.  Have to define the libname first with the opinion "dbmstemp=yes" along with other teradata login statement.

 

Thanks.

PROC Star
Posts: 1,180

Re: run selected code in Proc SQL

Another option is SAS Studio. Apparently it has an "interactive mode", where an interactive procedure won't be terminated when submitted.

 

I can't test this, as I'm using Studio with SAS On Demand, which doesn't allow interactive mode.

 

Tom

Ask a Question
Discussion stats
  • 8 replies
  • 164 views
  • 1 like
  • 5 in conversation