LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 1997, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 8 Sep 1997 20:26:29 -0700
Reply-To:     Rob Hughes <rhughesmd@MSN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Rob Hughes <rhughesmd@MSN.COM>
Subject:      Re: Please Help with creating datasets from PROC SQL

Michael:

Try : PROC SQL : CREATE TABLE dlib.fcode AS ; <- can't remember if this semi colon necessary SELECT * FROM vlib.feecode ;

If I remember correctly, you shouldn't have to declare the field names and types before hand. Just check the semi-colon after the AS statement, I wrote this from my home PC and couldn't quite remember if it was necessary

Rob Hughes Applied Intelligence LLC email: rhughes@applied-intel.com

Michael Schramm <mschramm@postbox.acs.ohio-state.edu> wrote in article <5umiuc$b6r$1@charm.magnus.acs.ohio-state.edu>... > > Hello all, > > Is it easily possible to create SAS datasets from a PROC SQL statement? > > I have used the following successfully in the simple example below, but it > requires me to establish all the field names/types in advance. > Is there an easier or more direct way to dynamicall create the dataset? > I plan on creating an output set from a somewhat more complicated query > that joins five tables and don't want to establish the field names in advance. > > > %LET dbms=SQLSERVR; > %LET server=SQL; > %LET database=Student; > %LET username=mschramm; > %LET password=wouldntyouliketoknow; > > libname adlib 'C:\SASDATA\'; > libname vlib 'C:\SASDATA\'; > libname dlib 'C:\JUNK'; > > proc sql; /* make a table structure in my dlib */ > create table dlib.fcode (pricoll char(3), seccoll char(1), > feeclass char(1), feegroup char(1), feecode char(1) ); > > insert into dlib.fcode /* populate the table */ > select * from vlib.feecode; > > proc sql; /* this checks to make sure the data is there */ > select * from dlib.fcode; > > > quit; > > > > Thanks > > -- > Michael > |---------------------------+------------------------------------| > | Michael Schramm | mschramm@smtp.rpia.ohio-state.edu | > | Senior Academic Planner | mschramm@postbox.acs.ohio-state.edu| > | The Ohio State University |Tel:(614)292-2057 Fax:(614)292-2191| > |---------------------------+------------------------------------| > | University Resource Planning & Institutional Analysis | > | OAA - Finance | > | 19 Bricker Hall 190 N. Oval Mall Columbus, Ohio 43210 | > |----------------------------------------------------------------| > >


Back to: Top of message | Previous page | Main SAS-L page