LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 28 Sep 2006 13:25:44 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: Length function doesn't work (Data too long for column ...
              truncated)
Comments: To: irinfigvam@YAHOO.COM
In-Reply-To:  <20060928132021.24659.qmail@web34105.mail.mud.yahoo.com>
Content-Type: text/plain; format=flowed

Irin ,

Like some one already stated you are setting the length of the variables on one data set but printing another. Since we have no idea how you reated the data set you are printing we also have no idea whether or not variables in this data set will inherit the length from the ORIG data set or if they are respecified in some way.

Toby Dunn

When everything is coming at you all at once, your in the wrong lane.

A truly happy person is someone who can smile and enjoy the scenery on a detour.

From: Irin later <irinfigvam@YAHOO.COM> Reply-To: Irin later <irinfigvam@YAHOO.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Length function doesn't work (Data too long for column ... truncated) Date: Thu, 28 Sep 2006 06:20:21 -0700

Gwen, This is a whole part...

646 647 /* Check new variables */ 648 649 %macro diag1(dsn); 650 proc freq data=&dsn; 651 tables shot enroll ; 652 title "Frequency of new variables in &dsn"; 653 run; 654 %mend; 655 656 %macro diag2(dsn,resp); 657 proc print data=&dsn (obs=20); 658 var shot shotdate questiondate; 659 where shot = "&resp"; 660 title "Printout of &dsn to check shot variable where shot=&resp"; 661 run; 662 663 proc print data=&dsn (obs=20); 664 var enroll startdate enddate accepts_calls wrong_phone_number; 665 where enroll = "&resp"; 666 title "Printout of &dsn to check enroll variable where enroll=&resp"; 667 run; 668 669 %mend; 670 671 %diag1(flu_single2);

NOTE: There were 9762 observations read from the data set WORK.FLU_SINGLE2. NOTE: PROCEDURE FREQ used: real time 0.01 seconds cpu time 0.01 seconds

672 673 %diag2(flu_single2,Y); NOTE: There were 20 observations read from the data set WORK.FLU_SINGLE2. WHERE shot='Y'; NOTE: PROCEDURE PRINT used: real time 0.00 seconds cpu time 0.00 seconds

WARNING: Data too long for column "accepts_calls"; truncated to 93 characters to fit. WARNING: Data too long for column "wrong_phone_number"; truncated to 93 characters to fit. NOTE: There were 20 observations read from the data set WORK.FLU_SINGLE2. WHERE enroll='Y'; NOTE: PROCEDURE PRINT used: real time 0.01 seconds cpu time 0.01 seconds

674 %diag2(flu_single2,N); NOTE: There were 20 observations read from the data set WORK.FLU_SINGLE2. WHERE shot='N'; NOTE: PROCEDURE PRINT used: real time 0.00 seconds cpu time 0.00 seconds

WARNING: Data too long for column "accepts_calls"; truncated to 93 characters to fit. WARNING: Data too long for column "wrong_phone_number"; truncated to 93 characters to fit. NOTE: There were 20 observations read from the data set WORK.FLU_SINGLE2. WHERE enroll='N'; NOTE: PROCEDURE PRINT used: real time 0.00 seconds cpu time 0.00 seconds

Gwenael Besnier <gwen_1973@hotmail.com> wrote: Hi,

I'm not sure you sent the right part of the log: the macro with proc print is called diag2, however you invoke the macro %diag1! So, the error warnings are coming from what you do in diag1 and not from the proc print... What's in diag1?

HTH Gwen

>From: Irin later >Reply-To: Irin later >To: SAS-L@LISTSERV.UGA.EDU >Subject: Length function doesn't work (Data too long for column ... > truncated) >Date: Thu, 28 Sep 2006 06:01:18 -0700 > >At the very beginning of my code I set the length of the character data >fields like that: > data ORIG; > 593 length asked_question $ 6; > 594 length response_to_question $ 6; > 595 length accepts_calls $ 3; > 596 length wrong_phone_number $ 6; > > However after I run the whole code Print data caused a WARNING message >regarding too long data as below: > > 656 %macro diag2(dsn,resp); > 657 proc print data=&dsn (obs=20); > 658 var shot shotdate questiondate; > 659 where shot = "&resp"; > 660 title "Printout of &dsn to check shot variable where shot=&resp"; > 661 run; > 662 > 663 proc print data=&dsn (obs=20); > 664 var enroll startdate enddate accepts_calls wrong_phone_number; > 665 where enroll = "&resp"; > 666 title "Printout of &dsn to check enroll variable where >enroll=&resp"; > 667 run; > 668 > 669 %mend; > 670 > 671 %diag1(flu_single2); > > > WARNING: Data too long for column "accepts_calls"; truncated to 93 >characters to fit. > WARNING: Data too long for column "wrong_phone_number"; truncated to 93 >characters to fit. > NOTE: There were 20 observations read from the data set >WORK.FLU_SINGLE2. > WHERE enroll='Y'; > NOTE: PROCEDURE PRINT used: > real time 0.01 seconds > cpu time 0.01 seconds > > > I do not understand why LENGTH function, which I set at the very >beginning, does not work for these fields. Is it because of the macro? Why? >How can I fix it ? > > Thank you in advance, > > Irin > > > > >--------------------------------- >Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ >countries) for 2/min or less.

_________________________________________________________________ Die neue MSN Suche Toolbar mit Windows-Desktopsuche. Suchen Sie gleichzeitig im Web, Ihren E-Mails und auf Ihrem PC! Jetzt neu! http://desktop.msn.de/ Jetzt gratis downloaden!

--------------------------------- Why keep checking for Mail? The all-new Yahoo! Mail shows you when there are new messages.


Back to: Top of message | Previous page | Main SAS-L page