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

One of our users is looking to obtain the actual windows physical size of a SAS Data Set within Enterprise Guide - just wondering does anybody know a quick way of surfacing the file size up via Enterprise Guide?

We can provide this info by logging onto the server and using right click properties on the file in question via Windows. And we also have a piece of SAS code that will produce a report of physical table size in the library location. But both of these options are not a quick, click and view option for the user.

Thanks,

Tom

1 ACCEPTED SOLUTION

Accepted Solutions
Fraktalnisse
SAS Employee

Does this help? This lists the file sizes for all data sets in SASHELP library.

 

proc sql;
 select memname, filesize format=sizekmg10.1
   from dictionary.tables
   where libname='SASHELP' and memtype='DATA';
quit;

fsize.png

 

You can also use the Tasks->Data->Data Set Attributes task, which includes a File Size field in its report.

 

dsattr.png

 

View solution in original post

12 REPLIES 12
Patrick
Opal | Level 21

If you have already a piece of SAS code why can't the user run this code as well? You could implement it as an autocall macro so the end user would only need to call the macro passing in the path/filename. Is options XCMD set?

Oh, and if this is about SAS tables then you would want to create some SAS code which also lists the related indexes and the like.

mrtball
Obsidian | Level 7

Hello Partick,

Thank you for your response.

The SAS code uses the XCMD PIPE option which is unavailable to users for security reasons, we have to run the code directly on our SAS servers to get a successful output in the report.

I will take a look at the autocall macro's to see if we can provide a solution using those.

Thanks,

Tom

SASKiwi
PROC Star

Another option if you have a Windows SAS server is to provide a Windows share like: \\SASServer\FolderShare.

Then uses can navigate to the share in Windows Explorer on their PC and look at file properties.

Patrick
Opal | Level 21

That means you have NOXCMD set. That will make it very hard for users to retrieve file size information via SAS programs (autocall macro won't help).

You could try to implement this as a stored process which the user can call - the stored process would then need under a user/in an environment with XCMD set.

As for "NOXCMD for security reasons": Chris Hemedinger wrote a very good blog about this:

http://blogs.sas.com/content/sasdummy/2012/08/31/the-case-for-xcmd-privileges-in-sas-enterprise-guid...

HywelDaniels
SAS Employee

Hi Tom,

If you're not able to access the XCMD I'm fairly sure you can use the VEXTFL (or DICTIONARY.EXTFILES if accessing via PROC SQL) dictionary table to achieve this, e.g.;

filename myfile 'C:\<path-to>\<my-file>.sas7bdat';

data _null_;
set sashelp.vextfl(where=(fileref='MYFILE'));
/* Calculate size in MB */
filesize=filesize/(1024**2);
call symputx('filesize',filesize);
run;

Fraktalnisse
SAS Employee

Does this help? This lists the file sizes for all data sets in SASHELP library.

 

proc sql;
 select memname, filesize format=sizekmg10.1
   from dictionary.tables
   where libname='SASHELP' and memtype='DATA';
quit;

fsize.png

 

You can also use the Tasks->Data->Data Set Attributes task, which includes a File Size field in its report.

 

dsattr.png

 

tlk
Quartz | Level 8 tlk
Quartz | Level 8

I didn't know about that dictionnary library, I guess it use sashelp.vtable, but vtable seems to contain only user define library.   Good to know about the dictonnay library.

Thanks, I'm always on the look out for those little things.

Ksharp
Super User

No. I don't think so. It is depended on different engine.

If engine is SPDS , you can't get that on account of a table is split into a several sub-table stored in different fold .

If it was SPDS , there is a command SPDSLS you can use to get the library’s size . Or use my code via UNIX command .

sowmya_mallela
Calcite | Level 5

Hi Chris, is there any possibility to add the functionality/feature of viewing data size all tables/datasets under each library in the next release of Enterprise guide explorer? I can see this functionality for folders that are under 'Home' but not under libraries. It would be better for sas users if this feature is available.  

 

Thank you

Sowmya Mallela

CaseySmith
SAS Employee

Hi Sowmya,

 

We don't know exactly what the user experience will be yet, but yes, we are planning on making it easier to get the file size (and any other properties that you can find in the server's dictionary tables) from within the EG UI in a future release.

 

Casey


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

TomKari
Onyx | Level 15

Another option is to use the "External Files" routines to pull out the file size. I don't have access to a server environment to test it, but I believe it would work fine, and it doesn't involve the X command capability.

Tom

jakarman
Barite | Level 11

My question would be what is the logical reason for that question. Dataset physical sizes will get a different meaning in some time. You can have index/auditfiles (adding more needed space) and having compression. It makes the once hard lined information become soft and less predictable.  When it is about managing the space and predicting the future needs than that is the question to solve.

---->-- ja karman --<-----

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!

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
  • 12 replies
  • 36379 views
  • 13 likes
  • 11 in conversation