|
|||
|
You can submit PROC SQL steps, in an SCL program, just as you would any
other SAS code: dcl string (13) inputTable; dcl string (5) outputTable; dcl string (32) yourVariable; inputTable='sashelp.class'; outputTable='height'; submit; proc sql; create view &outputTable as select &yourVariable from &inputTable; quit; endsubmit; For SQL only, you can also drop the PROC SQL, RUN, and QUIT statements if you use the SQL and CONTINUE options on the SUBMIT statement: submit sql continue; create view &outputTable as select &yourVariable from &inputTable; endsubmit; For the first example, code within the SUBMIT block doesn't get executed if you test the AF application in TESTAF mode. On the other hand, code within the SUBMIT SQL block does get executed if you test the AF application in TESTAF mode. The latter can make debugging easier. Once you have the data set, in the form of a data view or data file, you can use the variable values list model (sashelp.classes.Variablevalueslist_c.class) with the listbox control to display the unique variable values: Variablevalueslist.dataset=outputTable; Variablevalueslist.variable=yourVariable; Listbox.model='Variablevalueslist'; The listbox control (as well as the variable values list model) will have the unique values of yourVariable as its' items attribute. Although it isn't required to have Oracle return only unique values (the variable values list model will do it for you), it's probably more efficient. RandyHerbison@westat.com -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of yaobinmail@GMAIL.COM Sent: Tuesday, January 04, 2005 4:00 PM To: SAS-L@LISTSERV.UGA.EDU Subject: sql in SAS/AF Hello, I want to populate a listbox with items from Oracle table e.g set listbox.items to valuse from "proc sql select distinct ID from oraTable.tissue". I'm new for SAS/AF. I tried SAS doc but didn't find the answer. Thanks in advance. |
|
|
||||
|
||||
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Question on proc sql | Anindya Mozumdar | Newsgroup comp.soft-sys.sas | 0 | 06-15-2008 02:24 PM |
| Re: A SAS patch changed the way PROC SQL worked and changed the | nospam@HOWLES.COM (Howard Schreier | Newsgroup comp.soft-sys.sas | 0 | 12-07-2006 04:13 PM |
| Re: A SAS patch changed the way PROC SQL worked and changed the | Venky Chakravarthy | Newsgroup comp.soft-sys.sas | 0 | 12-05-2006 07:03 PM |
| Re: A SAS patch changed the way PROC SQL worked and changed the | Pardee, Roy | Newsgroup comp.soft-sys.sas | 0 | 12-05-2006 06:25 PM |
| future of SAS/AF | Michael L. Davis | Newsgroup comp.soft-sys.sas | 1 | 10-11-2005 04:01 AM |