BookmarkSubscribeRSS Feed
R_Win
Calcite | Level 5
In a library (Ex-Work). i have 20 Datasets .now i want to print all the datasets in that library at once. Message was edited by: Michel_SAS
4 REPLIES 4
venkatesh
Calcite | Level 5
Hi Michel.,

If u want all the 20 data sets in a single dataset do as follows

data test;
set sashelp.column
sashelp.company
------------------
------------------
------------------;
run;
proc print;
run;

and if u want to 20 datasets in a permanent library and assign a library.
LinusH
Tourmaline | Level 20
But if your tables don't have the same lay-out, you may wish to print them independently (but in the same program). You can use call execute from a data step that reads SASHELP.VMEMBER for instance.

/Linus
Data never sleeps
Cynthia_sas
SAS Super FREQ
Hi:
A clarification. The name of the data set is DICTIONARY.MEMBERS if you're using SQL and SASHELP.VTABLE or VSTABLE if you're using a DATA step program. Building CALL EXECUTE statements will happen in 1 DATA step program, that's true. However, the statements (PROC PRINTS) that are built do not represent 1 program, but a series of 20 PROC PRINT programs or steps that are put into a program queue. The 1 program that builds the CALL EXECUTE statements will run, then the 20 PROC PRINTS will run, AFTER the entire DATA step has finished building all the CALL EXECUTE statments.

There is an example of using CALL EXECUTE to build program code here:
http://support.sas.com/forums/thread.jspa?messageID=17077䊵
You would not need the conditional logic in that program.

Instead, you would search SASHELP views of the DICTIONARY tables and build your PROC PRINTS as illustrated. More information on SASHELP and DICTIONARY processing is described here:
http://www2.sas.com/proceedings/sugi26/p017-26.pdf
http://www2.sas.com/proceedings/forum2007/235-2007.pdf

cynthia
deleted_user
Not applicable
😉

Michel_SAS

How would your printer cope with 20 datasets to print "at once"?

it wouldn't!
It would print one at a time
unless, perhaps, you have 20 printers, but I don't expect so.

Much more likely ~ I expect you want 20 print files, or perhaps 20 worksheets in an excel workbook?

Even thought there is a PROC CONTENTS feature that conveniently reports on the structure of _all_ data sets in a SAS library, there is no corresponding feature of PROC PRINT to print the contents of all data sets in a library.
I like the possibility of drag-n-drop support in SAS Enterprise Guide (SEG) providing a quick delivery of multiple data sets into excel or some other output destination, but since SEG is not my field of expertise I can only recommend you pose your question on that forum at http://support.sas.com/forums/forum.jspa?forumID=10 .

In the "SAS Macro Facility, Data Step and SAS Language Elements" umbrella forum at http://support.sas.com/forums/forum.jspa?forumID=31 enthusiasts might package the printing of multiple data sets into a macro of some sort to achieve what you seek.

Even if SEG functionality supports your objective of conveniently "printing" all data sets at "once", I wouldn't refer to it as being achieved "at once" by a SAS Procedure
. ( so, sorry, wrong forum :).

Peter C

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