Date: Wed, 9 Feb 2011 09:58:28 -0500
Reply-To: Arthur Tabachneck <art297@ROGERS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@ROGERS.COM>
Subject: Re: Problem reading in example (was No Subject)
Toby,
The following might provide an explanation for why you lost space characters
when copying and pasting from a browser in unix:
http://bytes.com/topic/html-css/answers/101330-pre-versus-code-white-space-
pre-when-pasting
or, in short form: http://tiny.cc/7hi3e
Art
-------
On Tue, 8 Feb 2011 22:14:55 +0000, toby dunn <tobydunn@HOTMAIL.COM> wrote:
>Hmmm... thats wierd I just copied and pasted from my web browser to SAS
editor.
>Has to be something with that causing those extra spaces to be banished.
>
>Toby Dunn
>
>
>"I'm a hell bent 100% Texan til I die"
>
>"Don't touch my Willie, I don't know you that well"
>
>
>
>
>> Date: Tue, 8 Feb 2011 17:07:19 -0500
>> From: art297@ROGERS.COM
>> Subject: Re: Problem reading in example (was No Subject)
>> To: SAS-L@LISTSERV.UGA.EDU
>>
>> Toby,
>>
>> Yes, you missed something. In the code on the SAS website, and in Neal's
>> post, there were three spaces between all of the b and mydate values.
>> That's why he was getting a 1920 date.
>>
>> Art
>> -------
>> On Tue, 8 Feb 2011 21:58:30 +0000, toby dunn <tobydunn@HOTMAIL.COM>
wrote:
>>
>> >Art,
>> >
>> >Heres the code:
>> >
>> >data example;
>> >Format MyDate Date9. ;
>> >informat mydate mmddyy8.;
>> >input a $ b $ mydate ; ;
>> >datalines;
>> >wilma stone 01122001
>> >wilma stone 02122001
>> >wilma stone 01012001
>> >fred stone 03052008
>> >fred stone 03152008
>> >fred stone 03152009
>> >;
>> >run;
>> >
>> >
>> >Proc Print
>> > Data = Example ;
>> >Run ;
>> >
>> >
>> >
>> >Here is the Output:
>> > Obs MyDate a b
>> > 1 12JAN2001 wilma stone
>> > 2 12FEB2001 wilma stone
>> > 3 01JAN2001 wilma stone
>> > 4 05MAR2008 fred stone
>> > 5 15MAR2008 fred stone
>> > 6 15MAR2009 fred stone
>> >
>> >
>> >Am I missing anything?
>> >
>> >Toby Dunn
>> >
>> >
>> >"I'm a hell bent 100% Texan til I die"
>> >
>> >"Don't touch my Willie, I don't know you that well"
>> >
>> >
>> >
>> >
>> >> Date: Tue, 8 Feb 2011 16:54:21 -0500
>> >> From: art297@ROGERS.COM
>> >> Subject: Problem reading in example (was No Subject)
>> >> To: SAS-L@LISTSERV.UGA.EDU
>> >>
>> >> First, the example really did have it the way that Neal had posted the
>> code.
>> >>
>> >> Toby, did it really read that in as intended on a Sun? I would think
>> that,
>> >> other than how tabs would be treated, mixing input forms would work
the
>> same
>> >> way on all machines.
>> >>
>> >> Just curious,
>> >> Art
>> >> --------
>> >> On Tue, 8 Feb 2011 16:33:59 -0500, Arthur Tabachneck
<art297@ROGERS.COM>
>> >> wrote:
>> >>
>> >> >Neal,
>> >> >
>> >> >You have extra spaces in the data. Try to change the initial input
to:
>> >> >
>> >> >data example;
>> >> > informat mydate mmddyy8.;
>> >> > input a $ b $ mydate ; ;
>> >> > datalines;
>> >> >wilma stone 01122001
>> >> >wilma stone 02122001
>> >> >wilma stone 01012001
>> >> >fred stone 03052008
>> >> >fred stone 03152008
>> >> >fred stone 03152009
>> >> >;
>> >> >run;
>> >> >
>> >> >HTH,
>> >> >Art
>> >> >---------
>> >> >On Tue, 8 Feb 2011 16:18:51 -0500, Nair, Neal K (ACF)
>> >> ><neal.nair@ACF.HHS.GOV> wrote:
>> >> >
>> >> >>The following is taken from a recent SAS Tech Report: Leveraging
SAS.
>> >> >>
>> >> >>-- Use an Alias to Create Multiple Columns from the Same Variable
with
>> >> PROC
>> >> >REPORT
>> >> >>http://sems.sas.com/bess5/get?id=-55229.1:-
>> >> >gjvprg7y:e55i7&RZNVY=aanve@nps.uuf.tbi&nccvq=22501
>> >> >>
>> >> >>The example mentioned in the above is shown below:
>> >> >>
>> >> >>The following code illustrates how to use an alias to create
multiple
>> >> >columns from the same variable.
>> >> >>________________________________
>> >> >>
>> >> >>data example;
>> >> >> input a $ b $ mydate mmddyy8.; ;
>> >> >> datalines;
>> >> >>wilma stone 01122001
>> >> >>wilma stone 02122001
>> >> >>wilma stone 01012001
>> >> >>fred stone 03052008
>> >> >>fred stone 03152008
>> >> >>fred stone 03152009
>> >> >>;
>> >> >>run;
>> >> >>ods html;
>> >> >>title 'MIN and MAX date per patient';
>> >> >>proc report nowd data=example;
>> >> >> column a b mydate=min_mydate mydate=max_mydate;
>> >> >> define a / group;
>> >> >> define b / group;
>> >> >> define min_mydate / min format=mmddyy10. 'min date';
>> >> >> define max_mydate / max format=mmddyy10. 'max date';
>> >> >>run;
>> >> >>
>> >> >>ods html close;
>> >> >>
>> >> >>When I executed the above program, I got the year as 1920 for both
the
>> MIN
>> >> >and MAX dates.
>> >> >>
>> >> >>Could someone explain why?
>> >> >>
>> >> >>Thanks.
>> >> >>
>> >> >>Neal
>> >
>
|