BookmarkSubscribeRSS Feed
bk53
Calcite | Level 5

Hi,

 

is there a way to change the physical size of outputfiles?

I want to write a macro, which create testfiles with a determined size, the content does not matter.

 

Thanks

bk

11 REPLIES 11
Jagadishkatam
Amethyst | Level 16

Could you please give more details, you want to know the size the datasets or change the size of the datasets

Thanks,
Jag
bk53
Calcite | Level 5

I want to Change the size of the datasets.

My main Problem is, that i want to create a macro witth the Parameter size and this macro create testfiles wich have this size, but i cant find a way to do this.

 

thanks

bk

andreas_lds
PROC Star

@bk53 wrote:

I want to Change the size of the datasets.

My main Problem is, that i want to create a macro witth the Parameter size and this macro create testfiles wich have this size, but i cant find a way to do this.

 

thanks

bk


Size depends on the variables you create, the number of observations in the dataset and some other things like compression, page-size ... I should be possible to calculate the number of observations and variables to get a defined size. But i can't see a use-case requiring such files.

bk53
Calcite | Level 5

Thank you for your reply.

I need the data to test Transfer between to different Systems.

Is there a formula to calculate the size?

 

thanks

bk

Jagadishkatam
Amethyst | Level 16

If it is about determining the size of the existing dataset in a library, we can know it by the below code.

 

The dataset sized will create a dataset where it will have name and dataset in library and size with other variables.

 

proc sql;
create table sized as select * from dictionary.tables where libname='name';
quit;
Thanks,
Jag
bk53
Calcite | Level 5

Thanks.

Here is an example what i need: a 3MB file, a 1GB file, a 912KB file.

I just want to create them, but the Content doesn't metter.

 

Thanks

bk

ballardw
Super User

@bk53 wrote:

Thank you for your reply.

I need the data to test Transfer between to different Systems.

Is there a formula to calculate the size?

 

thanks

bk


First thing what are you using to measure "size"? Bytes, number of rows, number of characters, number of columns?

 

What type of file does this transfer need to use? Fixed column text files the size can be determined fairly easily but is dependent on how many characters per line.

Delimited text files such as CSV or Tab delimited would likely be not too difficult to create a fixed size but again content per line is important.

 

Binary files such as XLSX or structured files like XLM not so much. The XLSX can have a lot of overhead style information and the text format of XLM repeating variable names and types means that the actual names of variables affects total file size.

andreas_lds
PROC Star

@bk53 wrote:

Thank you for your reply.

I need the data to test Transfer between to different Systems.

Is there a formula to calculate the size?

 

thanks

bk


Have you seen http://support.sas.com/kb/51/659.html?

 

Astounding
Opal | Level 21
You could always use a little trial and error. For example:

data test1;
retain var1-var99 0;
do var100=0 to &nrecs;
output;
end;
run;

After a few tests you'll have a pretty good idea of how large &nrecs should be.
bk53
Calcite | Level 5

I used for nrecs values from 1 to 1000 and the size is every time 192kb.

Did i have to Change some Options?

Astounding
Opal | Level 21
These values are way too small. 1 means create a data set with 2 records. Start with a million and go from there.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 11 replies
  • 635 views
  • 0 likes
  • 5 in conversation