X-Vmsmail-To: SMTP%"SAS-L@uga.cc.uga.edu"
Newsgroups: bit.listserv.sas-l
Date:         Mon, 28 Sep 1992 00:29:02 -0500
Reply-To:     "(Glenn Millard)" <A_MILLARDGD@CCSVAX.SFASU.EDU>
From:         "(Glenn Millard)" <A_MILLARDGD@CCSVAX.SFASU.EDU>
Subject:      Inputting data with FSEDIT and variable lengths
Comments: To: SAS-L@uga.cc.uga.edu

 I am experimenting entering in data to SAS with FSEDIT. I am looking to
 extract this data set later so I am trying to see just what information
 can be entered. I noticed something interesting and wondered if the list
 could tell me why it is happening.
   I setup the following sample variables with lengths and formats:
        Variable Name      Length       Format
           VALUE2            2            1.
           VALUE3            2            3.
           VALUE4            8
           VALUE5            4            6.1
           VALUE6            8           10.
           VALUE7            8            5.3
           VALUE8            4            5.3

Since character variables work fine I am not concerned about them. FSEDIT
creates the data entry screen properly, no problem here. On VALUE5, VALUE7,
and VALUE8 when you try to enter more decimal point when specified it
truncates it properly, the same is true for VALUE3 and VALUE6. Now for the
interesting parts. First, VALUE4, here you can enter whole numbers or
numbers with fractions. I would expect this since no format was specified
with VALUE4. Question 1: If you can enter fractions in VALUE4 how do you
when you have them and how do you handle this if you try to extract this
variable from the data set back to ASCII. PROC CONTENTS will only report
the length of 8. What should you allow for a format, something like 15.8 or
more? The length of 8 makes for lots of possibilities.
 Next the the strange part for me. On VALUE7 and VALUE8 I can enter numbers
like 44564 or 454.5 and it stores these numbers properly in the data set.
This is not the type of number I intended for this variable and the format,
5.3, would lead me to assume I should not have a number above 9.999 or at
best 99.999 in one of these variables. I assume because the number is stored
in 4 or 8 bytes that the large number is stored properly, format or not.
Two questions: Is there a way to keep unexpected numbers like this from
being entered without having to write alot of SCL code? Providing the
unexpected number is stored, how would you extract it properly? Again here,
PROC CONTENTS only reports the length and the format. Here I would expect
I could use the format, 5.3, for the output format; but that would lose
information because I have large numbers stored in these variables that I
would not have expected could be there.

Note: I am using SAS 6.07 on a VMS platform. My reason for doing this is
partly for a paper I'm doing for a regional SAS conference and second because
I am advocating using FSEDIT as a better way to enter data then with the
VMS editor. Still, because SAS is still somewhat new here, we've had it
3 years, many professors still use SPSS, they've had it for 10+ years. In
these cases this data set will be needed to be extracted to an ASCII file.
My aim is to lose little, if any at all, of the data when I extract it. The
problems above complicate the matter tremendously.
Any help would be helpful. Noticing other questions about variable lengths
and extracting files on the list I would guess posting back to the list
could be helpful for many users.

Glenn Millard
Academic Support Programmer
SAS Consultant
Stephen F. Austin State University
Internet: a_millardgd@ccsvax.sfasu.edu