BookmarkSubscribeRSS Feed
JonDo
Calcite | Level 5

Hello all,

i am creating tables with some prompts...in these steps i´m creating some variables with :INTO and with them the output table gets created.

 

If i am "clicking" my way to the output table i get about 22M columns, but with my code version i get 22M minus 15k.

 

I compared the "clicked" code with my code via prompts and code, its the same code @ the end (checked it with %put).

 

Its a simple code

CREATE TABLE work... as

SELECT t1.columns
       t2.columns
              from work.x t1
              LEFT JOIN y t2 ON (t1.key = t2.key)

 

Like i said, i compared the clicked code with sas eg with my written...at the end its the same, but i´m missing 15k on colums.

The output data is i think the same, i compared some rows...(btw is there a function, where i can compare 2 Tables, if the data is the same?)

 

So...why?

 

5 REPLIES 5
Reeza
Super User

You mean 15K rows right? 22M columns would be unmanageable...

 

Please post the full code from each query and the log. With the basic of what you've shown there's no real way to tell the difference.

 

You can use PROC COMPARE to data sets, or Tasks>Data>Compare to compare two data sets.


@JonDo wrote:

Hello all,

i am creating tables with some prompts...in these steps i´m creating some variables with :INTO and with them the output table gets created.

 

If i am "clicking" my way to the output table i get about 22M columns, but with my code version i get 22M minus 15k.

 

I compared the "clicked" code with my code via prompts and code@, its the same code @ the end (checked it with %put).

 

Its a simple code

CREATE TABLE work... as

SELECT t1.columns
       t2.columns
              from work.x t1
              LEFT JOIN y t2 ON (t1.key = t2.key)

 

Like i said, i compared the clicked code with sas eg with my written...at the end its the same, but i´m missing 15k on colums.

The output data is i think the same, i compared some rows...(btw is there a function, where i can compare 2 Tables, if the data is the same?)

 

So...why?

 


 

SuryaKiran
Meteorite | Level 14

The maximum number of variables in SAS Datasets depends on your environment and the file's attributes.

Thanks,
Suryakiran
Patrick
Opal | Level 21

@JonDo

Just as something eventually worth trying: I believe some of the prompts are quoting the parameter values (using these non-printable SAS quoting hex value). It might be worth to add %unquote() functions around the macros in your code and see if this resolves the issue.

 

You can use the SQL EXCEPT operator to get rows which are unique to your table with more records.

http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/viewer.htm#a001361224.htm

Tom
Super User Tom
Super User

Why i am missing 15k columns

Do you really have over 15 thousand columns in your data set? That would be almost impossible to work with.

 creating some variables with :INTO

Not sure what this means. The INTO clause in PROC SQL is used to create MACRO variables. Note that macro variables can contain at the most 64K bytes.  So if you are trying to put 15 thousand variable names into a macro variable it will probably run out of room.

 

 

 

ballardw
Super User

My first suspect would be that one or both of the source tables changed size somewhere between your two tests.

 

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 5 replies
  • 729 views
  • 0 likes
  • 6 in conversation