BookmarkSubscribeRSS Feed
HimaAalamuri
Fluorite | Level 6

Hi all,

i have one doubt, within single block of sql -  how many tables we can create?

Best Regards,

Hima

9 REPLIES 9
LinusH
Tourmaline | Level 20

SAS uses ANSI 92 SQL, which means that only one table for each CREATE TABLE statement.

Number of tables created within a single PROC SQL; QUIT; block is unlimited...

Data never sleeps
HimaAalamuri
Fluorite | Level 6

i try to create around 50 tables with in proc sql and each table i am generating sequentical numbers by using monotonic() then i got some problem means

dataset1 i am generating seq numbers based on one variable it gives seq values like 1 2 3

dataset2 - seq numbers 1 2 3

dataset3 - seq numbers start with 2nd dataset last number that is 4 5 6 ...

why i am getting this problem??

if i create one sql block with dataset1 & dataset 2 and another proc sql block with dataset3 & dataset4 then i am not getting any problem..

pls help me out from this problem!

LinusH
Tourmaline | Level 20

First, monotonic() is unsupported, not (yet?) intended for production jobs.

Monotonic() numbers records in each statement. So with a new select it start over from 1. Much like _n_ in the data step.

Why do you want to create 50 different datasets, and have them numbered? Are they from the same source table? If so, the data step might be a better tool for you.

Data never sleeps
HimaAalamuri
Fluorite | Level 6

i am creating these tables for dummy records creation for each sub group

Thanx,

Hima

LinusH
Tourmaline | Level 20

I don't really get what you are doing. But if you are happy, I'm happy Smiley Happy

Data never sleeps
HimaAalamuri
Fluorite | Level 6

thank you!

i am formating the results based on display, if any subject coming to perticular group then i have to create that recored with null values that the reason i am creating dummy record datasets.

if i use datasetp the code will be more then i started first time with proc sql; then i faced this problem!

i hope now you got i am doing!

Thans,

Hima

HimaAalamuri
Fluorite | Level 6

and one more thing Linus, do have any idea how to compare two output window results by using any sas procedure..

Best regards,

Hima

LinusH
Tourmaline | Level 20

Sorry, don't follow you.

Since this seems to be a new question, open a new thread.

In that, attach your code so far, sample input data, and desired output data.

Data never sleeps
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yes, I am not following either.  Perhaps some test data/required output would clarify.  I would also mention that I believe there are limitations to how many tables can be used in one SQL block. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 1064 views
  • 2 likes
  • 3 in conversation