Desktop productivity for business analysts and programmers

Create and Register Tables (automatically) in Enterprise Guide

Reply
Occasional Contributor
Posts: 5

Create and Register Tables (automatically) in Enterprise Guide

Within Enterprise Guide 5.1, I am using PROC SQL to create a table within a BASE SAS library I had already created called 'DEV'. 

Sample:

create table dev.subscription_billing_failures as

select *...

After creating the table within the 'DEV' library, I went to build a cube from it and found that I could not do so until I registered it.  The table that I am creating in Enterprise Guide will be dropped and recreated daily as part of a scheduled job.  Is there a way to also register this table every day as part of the automated process so that I don't have to do so manually?

Thanks

Super Contributor
Posts: 1,636

Re: Create and Register Tables (automatically) in Enterprise Guide

Hi,

If you want you code run when server is connected, try click:

tools-options-sas programs- check "submit sas code when serve is connected" - edit, paste your code there. Attached is a screen shot.


eg.png
Super User
Posts: 3,233

Re: Create and Register Tables (automatically) in Enterprise Guide

Synchronising your SAS metadata with changed SAS data libraries can be done in a number of ways including:

1) Running PROC METALIB.

2) Use EG 5.1 Tools > Update Library Metadata

This document gives you more details:

http://support.sas.com/documentation/onlinedoc/guide/EG43MetaLibraries.pdf


While it describes EG 4.3, the same applies to EG 5.1

Respected Advisor
Posts: 4,131

Re: Create and Register Tables (automatically) in Enterprise Guide

There is a difference between a physical table (the one you create in your SQL job) and a metadata table object.

If you have a physical table then you can create a metadata table object (which is needed to build the cube) by simply using the attributes of the physical table and synching it with metadata. That's what I assume you've done.

Now even if you delete the physical table the table metadata object will still exist. You will get an error/warning when you click on it to see the underlying physical data (as there is none) but the object as such is still there. Just re-run your code creating the physical table and things will work again.

It's kind of like if you create a view. Only because you delete the table doesn't delete the view. The view won't work without the table but simply by re-creating the table the view will work again without any need to touch the view at all. And also like view and table: If the structure of the physical table changes (eg. column added or removed) the you have to re-created the view (or sync the metadata table object with the physical table).

Ask a Question
Discussion stats
  • 3 replies
  • 1021 views
  • 0 likes
  • 4 in conversation