DATA Step, Macro, Functions and more

SAS Dataset Full

Regular Contributor
Posts: 173

SAS Dataset Full

Hello everyone,

This is my first time posting on this forum. Any input would be greatly appreciated.

I was running a query on a few DB2 tables and writing the result to a sas dataset A. Then I got this error:

ERROR: Write to WORK.A.DATA failed. File is full and may be damaged.

Does this mean the sas dataset A is full?
I ran this on mainframe. Has anyone see this error before? Can I alter the size of a temporary sas dataset?

Thanks alot for your input!!
Not applicable
Posts: 0

Re: SAS Dataset Full

It generally means that the storage media the dataset is on is full.
On Unix, it's the filesystem.
On Windows, it's the logical drive
On a Mainframe, it's the pre-allocated extents
Not applicable
Posts: 0

Re: SAS Dataset Full

Posted in reply to deleted_user
The allocation of space on a mainframe was one of my earliest challenges. I would estimate the space required, call for a primary that would take 90% of the data set and then call for secondary extents that were 10% of the final size.

If sufficient space is available on the VolSer assigned, then in theory this should give you 90 + ( 15 * 10)% of the required space. The glitch in this estimation is that the primary must be assigned in five or fewer logical extents, or the assignment will fail. The second issue is that sufficient space exists to make the allocation required. In the above calculation, that means up to 240% of the expected file size. These assumptions are often premature as jobs fail reasonably late in the step due to space issues.

Try increasing your primary or secondary allocation sizes, and if your allocations are controlled by SMS, then pick a larger assignment pattern.

It may be that you cannot do either of these things, so a third option is to reduce the space stress by loading your memory a little with a request to compress the output data set. The following untested code will demonstrate the idea.

Data PERIOD( Compress = Yes);

The Compress option may be added to any output data set statement including those in statistical procedures and the sort procedure.

Kind regards

Not applicable
Posts: 0

Re: SAS Dataset Full

There is a WORK parameter, on the mainframe (z/OS) at least, that denotes the primary and secondary allocations.

If you run SAS in batch, this can be coded on the EXEC statement e.g.
//TEST EXEC SAS913,WORK='500 200'

If you run SAS under TSO, this can be coded as a parameter like:
SAS913 WORK('500 200')

By changing the above default values, you can easily increase the size of your work file.
Regular Contributor
Posts: 173

Re: SAS Dataset Full

Posted in reply to deleted_user
Chuck dkvj & bob,

Thank you all so much. That was some really useful information!

Thank you!!!
Not applicable
Posts: 0

Re: SAS Dataset Full

Posted in reply to deleted_user
You have to be careful here.

In Bob's case, there is a SAS proc titled SAS913, that takes a WORK= parameter.
That may or may not be available with your installation.

SAS has a temporary data library called "WORK".
Years ago, when I ran SAS on a mainframe, I had to be able to use more space than a single 3390 could hold, so I spanned WORK across many volumes. Of course, since I not there anymore, and it's been years, I can't give you the nitty gritty details.

What we did at that place, for general SAS use on the mainframe, was to create a named group of 3390-10's = SASDS. SASDS consisted of 10 DASD volumes, and WORK for any job could exist on any one of them. We used a generic specification of (273,273) for primary and secondary extent allocations. This kept all the space in same sized chunks for more efficient usage of storage. 273 was used because 273*16 = 4368 was just less than the maximum allocatable space of the disk (4369?), due to ???? limitations (I don't remember all the exact details). I think we used CYL for the allocation unit.

You can span WORK across at most 6 DASD volumes.
It is accomplished by creating 6 DSN's and then concatenating them together
something like the following.
//work1 dsn=work,space=(cyl,4300,rlse),unit=sasds,vol=ser=sasd01
//work2 dsn=work,space=(cyl,4300,rlse),unit=sasds,vol=ser=sasd02
//work3 dsn=work,space=(cyl,4300,rlse),unit=sasds,vol=ser=sasd03
//work4 dsn=work,space=(cyl,4300,rlse),unit=sasds,vol=ser=sasd04
//work5 dsn=work,space=(cyl,4300,rlse),unit=sasds,vol=ser=sasd05
//work6 dsn=work,space=(cyl,4300,rlse),unit=sasds,vol=ser=sasd06
//work dsn=work,unit=sasds,vol=(sasd01,sasd02,sasd03,sasd04,sasd05,sasd06)
I expect I'm missing something somewhere, but this should get you started, if you need it.
Ask a Question
Discussion stats
  • 5 replies
  • 2 in conversation