BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

hi,

i am supposed to  run a query such as

proc sql;

create table temp as select var1,var2

from have where var1>0

group by var2;quit;

and copy the results and paste into an excel sheet but when running my program file.sas which has this query i only get the log saying you created a  table of 100 records and 2 variables  but i dont get a file.lst file which would display the data so i can copy it and paste it.

it can not be a  dataset. has to be data i copy from the listing.  how do  i achieve this? anyone pls?

1 ACCEPTED SOLUTION

Accepted Solutions
Doc_Duke
Rhodochrosite | Level 12

"create able temp" creates a SAS data set. 

 

you can get a several ways:

  • Drop the "create table temp" and PROC SQL will just list the data.
  • Run proc print on "temp" to create the listing.

 

If you have SAS ACCESS licensed, you could directly export "temp" to Excel.

 

 

View solution in original post

5 REPLIES 5
Doc_Duke
Rhodochrosite | Level 12

"create able temp" creates a SAS data set. 

 

you can get a several ways:

  • Drop the "create table temp" and PROC SQL will just list the data.
  • Run proc print on "temp" to create the listing.

 

If you have SAS ACCESS licensed, you could directly export "temp" to Excel.

 

 

LinusH
Tourmaline | Level 20

Or use proc export to avoid the manual copy/paste operation.

Data never sleeps
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

Thank you!

Reeza
Super User

Copy and pasting is a bad idea, it's too easy to make mistakes.

 

If you can't export to excel due to some license restriction - ie no SAS/Access look into the following macro.

http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export

 

Or export to a CSV, and then save as an Excel file, since you're doing a manual step anyways.

Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

Thanks Reeza,

I did export  it into an excel file  but they did not want it that way. They have always been copying and pasting the listing. Dont know why.

the max ls(linesize) is 256 right?

I was  trying to shrink the  output a  bit but i guess in SAS thats  the maximum

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 1045 views
  • 5 likes
  • 4 in conversation