Date: Mon, 24 Aug 2009 13:10:09 -0400 Reply-To: msz03@albany.edu Sender: "SAS(r) Discussion" From: Mike Zdeb Subject: Re: About Cats function. Content-Type: text/plain;charset=iso-8859-1 hi ... via Louise Hadden (at ABT) and a "little birdie" adding a LENGTH statement (any length will do) seems to be the answer to some of the stuff Art investigated note: check the length of b_OFALLB ... so you thought that the default length of CATT results is 200, hmmmm ... (does this qualify as "kitty litter") data odd3; length b_ofalla \$ 50; input x \$ y z \$; b_ofalla = catt(of _all_); b_ofallb = catt(of _all_); b_ofxyz = catt(of x,y,z); cards; 001 002 003 000 001 002 000 000 000 ; run; proc print data=odd3; run; proc contents data=odd3; ods select variables; run; Obs b_ofalla x y z b_ofallb b_ofxyz 1 0012003 001 2 003 120030012003 0012003 2 0001002 000 1 002 10020001002 0001002 3 0000000 000 0 000 0 0000000 Alphabetic List of Variables and Attributes # Variable Type Len 1 b_ofalla Char 50 5 b_ofallb Num 8 6 b_ofxyz Char 200 2 x Char 8 3 y Num 8 4 z Char 8 and Art's earlier examples both work OK with NO LOG MESSAGES if LENGTH statements are added (again, any length will do) try these and take a look what happens by the time you get to variable C in both data steps data odd1; length a b c \$100; input x y z (xx yy zz) (\$); a=cats(of _all_); b=cats(of _numeric_); c=cats(of _character_); d=cats(of x,y,z); e=cats(x,y,z); cards; 1 2 3 a a a 0 1 2 b b b 0 0 0 c c c ; run; data odd2; length a b c \$100; input x y z; a=cats(of _all_); b=cats(of _numeric_); c=cats(of _character_); d=cats(of x,y,z); e=cats(x,y,z); cards; 1 2 3 0 1 2 0 0 0 ; run; -- Mike Zdeb U@Albany School of Public Health One University Place Rensselaer, New York 12144-3456 P/518-402-6479 F/630-604-1475

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