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 (June 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 2 Jun 2011 10:14:22 -0400
Reply-To:     Nat Wooding <nathani@VERIZON.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Nat Wooding <nathani@VERIZON.NET>
Subject:      Re: SAS informat for this COBOL picture "9(7)V999" with length of
              10?
In-Reply-To:  <201106011254.p51AnAHh011940@willow.cc.uga.edu>
Content-Type: text/plain; charset="US-ASCII"

Jerry

I have not seen any replies to this note and, having a spare moment, I went looking for information on COBOL layouts. As far as I can tell, you can either have a number with an explicit decimal or an implied decimal. In either case, the 999 indicates three decimal digits. If SAS encounters a decimal in a numeric field, it then recognizes it even though you may have specified more decimal digits. Take a look at the following code and I think it will help. And, as far as I can tell, 10.3 will work properly for the two cases that you gave.

Nat Wooding

Data Jerry; input character $10. @1 number 10.3; put character= number=; cards; 12345 12.345 1234.5 run;

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jerry Sent: Wednesday, June 01, 2011 8:55 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: SAS informat for this COBOL picture "9(7)V999" with length of 10?

Great point! As you expected, the field only appear as 1234567890, there is NO decimal.

One further question: is 10.3 informat correct for either "picture (9)7V999" or "pic (9)7V.999"? Or it's correct for only "picture (9)7V999"?

Thank you!

On Tue, 31 May 2011 17:49:42 -0700, Mark Miller <mdhmiller@GMAIL.COM> wrote:

>I would expect the data in the text file to >appear as 1234567890 >i.e. the picture (9)7V999 has only an implicit decimal point. > >An explicit decimal point must be included in the picture >as in pic (9)7V.999 > >Nonetheless, the input format should be 10.3 > >On 5/31/2011 4:02 PM, Nat Wooding wrote: >> I just reread this post. When you look at the txt file, do you see the >> number that you would expect as in >> >> 123456.890 >> >> Meaning 9 digits and a decimal? If so, COBOL has long since stopped being >> part of its life and a format of 10.3 should read it. >> >> Nat Wooding >> >> -----Original Message----- >> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jerry >> Sent: Tuesday, May 31, 2011 4:11 PM >> To: SAS-L@LISTSERV.UGA.EDU >> Subject: SAS informat for this COBOL picture "9(7)V999" with length of 10? >> >> Hi, >> >> I am trying to read into SAS (on Windows) a column with COBOL picture of >> "9(7)V999" and a length of 10 (from a .txt file), I guess the corresponding >> SAS informat should be 10.3 >> >> But I really don't know much about COBOL picture, so could any expert >> confirm whether or not the correct corresponding SAS informat should be 10.3 >> for this COBOL picture? If not, what is it then? >> >> Thanks!


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