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


Hi,

I'm new to this community, so I hope I have the right forum for this question. I have a SAS file that I export to Excel on a daily basis. As you can see, it's really quite small -- never more than 100 observations at a time (file/field names blanked out or changed for confidentiality):

*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*

The CONTENTS Procedure

Data Set Name                                                         Observations           100
Member Type          DATA                                             Variables              8
Engine               V9                                               Indexes                0
Created              Friday, March 08, 2013 07:07:03 AM               Observation Length     67
Last Modified        Friday, March 08, 2013 07:07:03 AM               Deleted Observations   0
Protection                                                            Compressed             CHAR
Data Set Type                                                         Reuse Space            NO
Label                                                                 Point to Observations  YES
Data Representation  HP_UX_64, RS_6000_AIX_64, SOLARIS_64, HP_IA64    Sorted                 NO
Encoding             latin1  Western (ISO)


                                         Engine/Host Dependent Information

Data Set Page Size          8192
Number of Data Set Pages    3
Number of Data Set Repairs  0
Filename                   
Release Created             9.0202M3
Host Created                AIX
Inode Number                1664019
Access Permission           rw-r-----
Owner Name                 
File Size (bytes)           32768


                      Alphabetic List of Variables and Attributes

#    Variable            Type    Len    Format    Informat

1    fld_1               Char     10    $10.      $10.   
2    fld_2               Num       8                     
3    fld_3               Num       8                     
4    fld_4               Num       8                     
5    fld_5               Num       8                     
6    fld_6               Num       8                     
7    fld_7               Num       8                     
8    fld_8               Char      9                     

*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*

I then perform the following:

proc export data=SmallFile
            outfile="SmallFile.xls"
            DBMS=xls
            label
            replace;
  run;

NOTE: The export data set has 100 observations and 8 variables.
NOTE: "SmallFile.xls" file was successfully created.
NOTE: PROCEDURE EXPORT used (Total process time):
      real time           0.17 seconds
      cpu time            0.01 seconds

So far, so good. The Excel file created, however, is over 4MB in size. Any ideas as to why this is occurring? I've seen several posts talking about file sizes, but in everything I've seen the starting SAS dataset is very large, which is not the case here.

Thanks,

John

1 ACCEPTED SOLUTION

Accepted Solutions
LarryWorley
Fluorite | Level 6

Hi John,

I notice in the proc contents that your data set is compressed.  How about checking the uncompressed size in sas and see if the size comparisons between sas and excel are comparable?

You can run proc contents on the data set created by the following code:

data notSoSmall (compress = no) ;

  set smallFile;

run ;

Larry


View solution in original post

3 REPLIES 3
LarryWorley
Fluorite | Level 6

Hi John,

I notice in the proc contents that your data set is compressed.  How about checking the uncompressed size in sas and see if the size comparisons between sas and excel are comparable?

You can run proc contents on the data set created by the following code:

data notSoSmall (compress = no) ;

  set smallFile;

run ;

Larry


JohnC
Calcite | Level 5

Worked like a charm, Larry -- thanks!

Reeza
Super User

If its 800 observations it shouldn't be 4MB.

Check your character variables are they $256. each or something?

Also try the other engines for export, e.g. dbms=excel and/or dbms=excelcs

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 2219 views
  • 0 likes
  • 3 in conversation