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
Jade | Level 19

@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
Jade | Level 19

@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
PROC Star
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
PROC Star
These values are way too small. 1 means create a data set with 2 records. Start with a million and go from there.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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