<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Schemas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838617#M331569</link>
    <description>&lt;P&gt;Something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;connect to odbc(dsn= pw= .........);&lt;/P&gt;
&lt;P&gt;select *&lt;BR /&gt;from connection to odbc(ODBC::SQLTables);&lt;BR /&gt;quit;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 12:09:52 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2022-10-14T12:09:52Z</dc:date>
    <item>
      <title>Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838586#M331557</link>
      <description>I have lots of sas datasets. We are about to create schemas in oracle. How can i get the schemas from sas, seems proc content do not already identify primary keys foreign keys</description>
      <pubDate>Fri, 14 Oct 2022 09:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838586#M331557</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-10-14T09:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838589#M331558</link>
      <description>&lt;P&gt;Oracle schemas are - very loose comparison - more like your folders where you store tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Contents shows you what has been physically implemented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With SAS tables most of the time PK's, indexes and even more so foreign key constraints don't get physically implemented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What to physically implement in Oracle needs planning/design, will need scripting (DDL's) and you need of course to know your data and the relationships between the tables (data model).&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 09:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838589#M331558</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-10-14T09:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838617#M331569</link>
      <description>&lt;P&gt;Something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;connect to odbc(dsn= pw= .........);&lt;/P&gt;
&lt;P&gt;select *&lt;BR /&gt;from connection to odbc(ODBC::SQLTables);&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 12:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838617#M331569</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-10-14T12:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838635#M331575</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I have lots of sas datasets. We are about to create schemas in oracle. How can i get the schemas from sas, seems proc content do not already identify primary keys foreign keys&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is because you generally do not need to worry about such things with a SAS dataset.&lt;/P&gt;
&lt;P&gt;If you want to define primary keys etc in your Oracle database then you will need to do that yourself.&lt;/P&gt;
&lt;P&gt;If you need help guessing what might be a key you might want to check out the NLEVELS option on PROC FREQ.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=mylib.mydataset nlevels;
   tables _all_ / noprint;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If something has the same number of levels as there are observations in the dataset then it is a good candidate for a key.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.class nlevels;
 tables _all_ / noprint;
run;
proc contents data=sashelp.class varnum ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1665756188727.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76189i0EB16EB4AF9DBC55/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1665756188727.png" alt="Tom_0-1665756188727.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks like NAME is the primary key for SASHELP.CLASS.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 14:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838635#M331575</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-14T14:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838648#M331579</link>
      <description>&lt;P&gt;You have two different concepts in there, schemas and primary keys.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Schema is more like SAS library that helps you organize your data into subject matter domains.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Primary Keys help with lookup and joins and indexes (if created). Primary Keys are not a concept really recognized in SAS and you usually use a third party data governance tool to look at your data models.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 15:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838648#M331579</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-14T15:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838823#M331665</link>
      <description>What is third party governance tool here?</description>
      <pubDate>Sat, 15 Oct 2022 15:40:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838823#M331665</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-10-15T15:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838830#M331671</link>
      <description>&lt;P&gt;This all falls under integrity rues and constraints. Such are usually implemented in database systems, like Oracle, DB/2, MySQL, MS SQL Server, Postgres, and many others.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 17:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838830#M331671</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-15T17:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838881#M331690</link>
      <description>&lt;P&gt;ER Studio/ERwin are usually used for storing ER models. There are many alternatives out of there and some DBs have them built in these days.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 23:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838881#M331690</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-16T23:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838885#M331692</link>
      <description>Thanks Tom. What if no such variables exist, ( ie proc freq level n not equal or close to obersatiin from proc content?&lt;BR /&gt;&lt;BR /&gt;Moreover how to deal with foreign keys?</description>
      <pubDate>Mon, 17 Oct 2022 01:10:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838885#M331692</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-10-17T01:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838891#M331695</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks Tom. What if no such variables exist, ( ie proc freq level n not equal or close to obersatiin from proc content?&lt;BR /&gt;&lt;BR /&gt;Moreover how to deal with foreign keys?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why would you need to define the foreign keys?&amp;nbsp; You didn't need them when you were using the data with SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are starting a new project that will work with this data in some other database tool then follow the normal processes you use to build a database in that tool.&amp;nbsp; Just because you already have the data (or at least the starting point of the data) probable does not really change that process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 03:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838891#M331695</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-17T03:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838980#M331725</link>
      <description>Foreign keys are more of a concept than a physical construct They tell you how the join the data but they don't affect the data. You still have access to the variables and the values. You can use them in the analysis and joins the same way you would in a DB.</description>
      <pubDate>Mon, 17 Oct 2022 14:21:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/838980#M331725</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-17T14:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839034#M331735</link>
      <description>If i am to create tables in Oracle, what do I really need?</description>
      <pubDate>Mon, 17 Oct 2022 17:37:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839034#M331735</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-10-17T17:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839042#M331737</link>
      <description>&lt;P&gt;If you don't have anyone creating an Oracle data model for you to load into, ask your Oracle DBA for advice.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 19:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839042#M331737</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-10-17T19:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839048#M331740</link>
      <description>The correct access privileges?&lt;BR /&gt;&lt;BR /&gt;It depends on type of scope. Are you creating tables for others to use that require foreign keys/schemas? For yourself/team to maintain processes?&lt;BR /&gt;I would create tables using SAS SQL Pass through to create the tables and then insert using SAS libraries/steps as needed. You can create foreign keys using SQL Pass through and primary keys in SAS directly.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Oct 2022 19:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839048#M331740</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-17T19:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839105#M331770</link>
      <description>A dba creating for us with correct access privileges. Then my team will maintian. What is sql pass through?</description>
      <pubDate>Tue, 18 Oct 2022 00:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839105#M331770</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-10-18T00:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839106#M331771</link>
      <description>We are creating table in orAcle then the transformation we use data stage and may be oracle if required.</description>
      <pubDate>Tue, 18 Oct 2022 00:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839106#M331771</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-10-18T00:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839108#M331773</link>
      <description>&lt;P&gt;SQL Pass Through:&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n0dbrcxwx9q7non1wvcw2l54xa3m.htm" target="_blank"&gt;SAS Help Center: How the SQL Pass-Through Facility Works&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 01:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839108#M331773</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-10-18T01:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Schemas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839211#M331829</link>
      <description>&lt;P&gt;What does maintain mean to you?&lt;BR /&gt;Insert, update, and/or delete records?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, all of that is doable from Base SAS with a libname connection. Treat them as SAS datasets and you should be fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, do test how date and datetimes work and ensure you're aware of how to update/insert dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;A dba creating for us with correct access privileges. Then my team will maintian. What is sql pass through?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 15:25:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Schemas/m-p/839211#M331829</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-18T15:25:15Z</dc:date>
    </item>
  </channel>
</rss>

