LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (May 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 21 May 2002 02:03:15 -0400
Reply-To:     "Michael L. Davis" <michael@BASSETTCONSULTING.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Michael L. Davis" <michael@BASSETTCONSULTING.COM>
Subject:      Re: Help With Numeric InFormat!!!
In-Reply-To:  <d0dbf51e.0205201603.342a3c42@posting.google.com>
Content-Type: text/plain; charset="us-ascii"; format=flowed

Hello SAS-L Friends,

Each number between the comma delimiters in the data that was shared is standard numeric data. SAS has no trouble with the plus sign (+) and no special informat need be specified to read it.

All that was needed for this application was to specify the DSD option to tell SAS to respect the comma (,) as a delimiter, just as if there had been blanks between each field as is the case with list input. The DSD option, plus the trailing @ to hold the input pointer on the same raw data record until the third number has been read does the trick.

Minor confession. I had just finished the web-based training for the V8 SAS Core Concepts certification exam so I knew that answer cold. If you had asked me a month ago or a month from now, I might have to look it up. I'm not a big fan of SAS certification but the review was a good refresher on how to read all sorts of raw data. There probably are some good recent SUGI papers that you can read on the web that would do the same thing. Clint Rickards authored a dandy one a few years ago.

- Michael "Mad Doggy" Davis

At 05:03 PM 5/20/2002 -0700, Please Me <p_me@HOTMAIL.COM> wrote: >Thank you "Mad Doggy" - it worked. But why??? Is this not supposed to >be one of those funky values you use S370FPD or S370* for? > >Bunmi. > >michael@BASSETTCONSULTING.COM (Michael L. Davis) wrote in message >news:<5.1.0.14.2.20020518054656.00a92000@pop.registeredsite.com>... > > Hello SAS=L Friends, > > > > The secret is to use no informat at all! You need the dsd option and a DO > > loop with trailing at. Run the following code and observe. > > > > data work.sasl ; > > infile '<raw-data-file>' dsd ; > > do i=1 to 3 ; > > input mynumber @ ; > > output ; > > end ; > > run ; > > proc print data=work.sasl ; > > format mynumber 5.3 ; > > run ; > > > > - Michael "Mad Doggy" Davis > > > > At 01:20 AM 5/18/2002 -0700, Please Me <p_me@HOTMAIL.COM> wrote: > > >Hi all, > > > > > >Below is a sample of numeric values I am trying to read. I need help > > >with the correct informat with associated width & decimal places. > > >Thanks. > > > > > >+0000001.645,+0000002.581,+0000000.000 > > >+0000000.000,+0000000.000,+0000000.000 > > >+0000000.000,+0000000.000,+0000000.000 > > >+0000000.000,+0000000.000,+0000000.000 > > >+0000000.000,+0000000.000,+0000000.000 > > >+0000000.000,+0000000.000,+0000000.000 > > >+0000001.221,+0000000.000,+0000000.000 > > >+0000000.000,+0000000.000,+0000000.000 > > >+0000000.000,+0000000.000,+0000000.000 > > >+0000000.000,+0000000.000,+0000001.972 > > > > Michael L. Davis > > Vice President > > Bassett Consulting Services, Inc. > > 10 Pleasant Drive > > North Haven CT 06473-3712 > > E-Mail: michael@bassettconsulting.com > > Web: http://www.bassettconsulting.com > > Telephone: 203-562-0640 > > Facsimile: 203-498-1414 > > Messages: 888-477-1412 > > > > --

Michael L. Davis Vice President Bassett Consulting Services, Inc. 10 Pleasant Drive North Haven CT 06473-3712 E-Mail: michael@bassettconsulting.com Web: http://www.bassettconsulting.com Telephone: 203-562-0640 Facsimile: 203-498-1414 Messages: 888-477-1412


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