From: My on
I found this macro a number of years ago, and use it all the time to
reduce file sizes. I'm not sure if this is where I got it, but you can
see it here: http://www.nesug.org/Proceedings/nesug06/io/io18.pdf

I only started using SAS 9.2 in the last few months. When I run the
macro in 9.2, I get an error message I never got before:

WARNING: Multiple lengths were specified for the variable V1 by input
data set(s). This may cause truncation of data.

I believe this message comes after this data step:

data &DSNOUT ;
&RETAIN ;

%if &N_CHAR > 0 %then %str( &SQZ_CHAR ; ) ; /* optimize char
var lengths */

%if &N_NUM > 0 %then %str( &SQZ_NUM ; ) ; /* optimize
numeric var lengths */

%if &N_CHAR > 0 %then %str( &SQZ_CHAR_FMT ; ) ; /* adjust char
var format lengths */

set &DSNIN ;
run ;

I get the message for every variable. Does anyone know why this would
happen?

Thanks.
Myra
From: Arthur Tabachneck on
Myra,

I couldn't even get the code in the pdf to run on 9.1.3. However, there
does appear to be an updated version on the SAS site.

Take a look at: http://support.sas.com/kb/24/804.html and let the list know
if the updated code, there, corrects the problem.

Art
-------
On Wed, 11 Nov 2009 13:34:44 -0800, My <my0402(a)GMAIL.COM> wrote:

>I found this macro a number of years ago, and use it all the time to
>reduce file sizes. I'm not sure if this is where I got it, but you can
>see it here: http://www.nesug.org/Proceedings/nesug06/io/io18.pdf
>
>I only started using SAS 9.2 in the last few months. When I run the
>macro in 9.2, I get an error message I never got before:
>
>WARNING: Multiple lengths were specified for the variable V1 by input
>data set(s). This may cause truncation of data.
>
>I believe this message comes after this data step:
>
> data &DSNOUT ;
> &RETAIN ;
>
> %if &N_CHAR > 0 %then %str( &SQZ_CHAR ; ) ; /* optimize char
>var lengths */
>
> %if &N_NUM > 0 %then %str( &SQZ_NUM ; ) ; /* optimize
>numeric var lengths */
>
> %if &N_CHAR > 0 %then %str( &SQZ_CHAR_FMT ; ) ; /* adjust char
>var format lengths */
>
> set &DSNIN ;
> run ;
>
>I get the message for every variable. Does anyone know why this would
>happen?
>
>Thanks.
>Myra
From: xlr82sas on
On Nov 11, 4:18 pm, art...(a)NETSCAPE.NET (Arthur Tabachneck) wrote:
> Myra,
>
> I couldn't even get the code in the pdf to run on 9.1.3.  However, there
> does appear to be an updated version on the SAS site.
>
> Take a look at:http://support.sas.com/kb/24/804.htmland let the list know
> if the updated code, there, corrects the problem.
>
> Art
> -------
>
>
>
> On Wed, 11 Nov 2009 13:34:44 -0800, My <my0...(a)GMAIL.COM> wrote:
> >I found this macro a number of years ago, and use it all the time to
> >reduce file sizes. I'm not sure if this is where I got it, but you can
> >see it here:http://www.nesug.org/Proceedings/nesug06/io/io18.pdf
>
> >I only started using SAS 9.2 in the last few months. When I run the
> >macro in 9.2, I get an error message I never got before:
>
> >WARNING: Multiple lengths were specified for the variable V1 by input
> >data set(s). This may cause truncation of data.
>
> >I believe this message comes after this data step:
>
> >   data &DSNOUT ;
> >      &RETAIN ;
>
> >      %if &N_CHAR > 0 %then %str( &SQZ_CHAR ;     ) ; /* optimize char
> >var lengths      */
>
> >      %if &N_NUM  > 0 %then %str( &SQZ_NUM ;      ) ; /* optimize
> >numeric var lengths   */
>
> >      %if &N_CHAR > 0 %then %str( &SQZ_CHAR_FMT ; ) ; /* adjust char
> >var format lengths */
>
> >      set &DSNIN ;
> >   run ;
>
> >I get the message for every variable. Does anyone know why this would
> >happen?
>
> >Thanks.
> >Myra- Hide quoted text -
>
> - Show quoted text -

Roland Rashleigh-Berry
has an oplength macro which I have found very useful.
note 'option compress=binary;' - does a prety goo job on numerics.

It does not reduce the length of numeric variables but does create a
lenght statement for character variables

http://www.datasavantconsulting.com/roland/
http://www.datasavantconsulting.com/roland/maclist2.html

The macro is also on my site with sample data

http://homepage.mac.com/magdelina/.Public/utl.html
utl_tipweb.txt

/* T002920 OPTIMUM LENGTH FOR SAS VARIABLES BASED ON WORK BY Roland
Rashleigh-Berry */

From: Michael Raithel on
Dear SAS-L-ers,

Myra posted the following:

>
> I found this macro a number of years ago, and use it all the time to
> reduce file sizes. I'm not sure if this is where I got it, but you can
> see it here: http://www.nesug.org/Proceedings/nesug06/io/io18.pdf
>
> I only started using SAS 9.2 in the last few months. When I run the
> macro in 9.2, I get an error message I never got before:
>
> WARNING: Multiple lengths were specified for the variable V1 by input
> data set(s). This may cause truncation of data.
>
> I believe this message comes after this data step:
>
> data &DSNOUT ;
> &RETAIN ;
>
> %if &N_CHAR > 0 %then %str( &SQZ_CHAR ; ) ; /* optimize char
> var lengths */
>
> %if &N_NUM > 0 %then %str( &SQZ_NUM ; ) ; /* optimize
> numeric var lengths */
>
> %if &N_CHAR > 0 %then %str( &SQZ_CHAR_FMT ; ) ; /* adjust char
> var format lengths */
>
> set &DSNIN ;
> run ;
>
> I get the message for every variable. Does anyone know why this would
> happen?
>
Myra, ah yes, the old %SQUEEZE macro; it's good to see an old friend still going strong in the workforce!

I can't help you with that particular problem. However, I did note that you "...use it all the time to reduce file sizes..." and thought that I would offer an alternative that you may decide to use if my SAS-L brethren and sisteren do not come up with the answer that you need.

SAS data set compression is also a good tool for reducing the size of SAS data sets. It is easy to use and pretty effective when your data sets have a lot of redundant adjacent data in them. There is a CPU Time "penalty" for processing compressed SAS data sets, due to SAS having to decomp the data, but that is often made up for in faster transfer times of more observations per I/O. If CPU Time is not an issue for you and disk space is, then you might want to consider SAS data set compression.

Here is a link to the documentation under SAS V9.2:

http://support.sas.com/documentation/cdl/en/lrcon/61722/PDF/default/lrcon.pdf

....go to page 528 and read from the bottom onward. Note that there

One final note: In some cases, if you attempt to compress a SAS data set that does not have enough adjacent redundancy in its observations, you can end up with a compressed SAS data set bigger than the original. So, as always (at this point, you know what I am going to say, right?) check the SAS log after running your program! It will tell you the amount of space saved... and sometimes lost:-)

Myra, best of luck in all of your SAS endeavors!


I hope that this suggestion proves helpful now, and in the future!

Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates. All SAS code and/or methodologies specified in this posting are for illustrative purposes only and no warranty is stated or implied as to their accuracy or applicability. People deciding to use information in this posting do so at their own risk.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Michael A. Raithel
"The man who wrote the book on performance"
E-mail: MichaelRaithel(a)westat.com

Author: Tuning SAS Applications in the MVS Environment

Author: Tuning SAS Applications in the OS/390 and z/OS Environments, Second Edition
http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=58172

Author: The Complete Guide to SAS Indexes
http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=60409

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Anyone who lives within their means suffers from a lack of
imagination. - Oscar Wilde
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
From: Chang Chung on
On Wed, 11 Nov 2009 13:34:44 -0800, My <my0402(a)GMAIL.COM> wrote:
....
>I only started using SAS 9.2 in the last few months. When I run the
>macro in 9.2, I get an error message I never got before:
>
>WARNING: Multiple lengths were specified for the variable V1 by input
>data set(s). This may cause truncation of data.
....
hi,
it seems that this warning can be avoided by setting the varlenchk system
option to nowarn. This system option is available to the second phase of 9.2
(9.2 TS2M0) on most platforms or as a hot fix. See this note for the details:
http://support.sas.com/kb/31/850.html
cheers,
chang