Date: Wed, 16 Mar 2005 11:34:14 -0800
Reply-To: Tim <tim.obrey@MAINE.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tim <tim.obrey@MAINE.GOV>
Organization: http://groups.google.com
Subject: Re: Reading (fetching) values from a SAS dataset
In-Reply-To: <39r9odF63qhuiU1@individual.net>
Content-Type: text/plain; charset="iso-8859-1"
There are 50+ variables in the streams1 dataset. The key fields are
formatted as follows:
watcode $32. secbegin 8.1 secend 8.1 temp_sect $1.
There are no computed values.
There was a typo Sebegin=>Secbegin but that did not solve the problem.
The field for SECBEGIN in the fsedit screen was $8. I changed it to
numeric but it still doesn't work properly. The Log contains warning
message "Converting numeric variable SECBEGIN to character".
When I create a new obs and enter a watcode the pgm self-fills with the
first observation in streams3. All of the variables are diplayed
correctly, but it is not selecting properly.
Richard A. DeVenezia wrote:
> Tim wrote:
> > I am trying to fetch values from a dataset based on input from a
user
> > in an fsedit screen. The code is below. The user should enter a
> > watcode ($) and the secbegin (numeric section number) the program
> > should then pull in values for other fields. This works fine when
> > just using the watcode or if I substitute another $ variable for
> > secbegin. It seems to have trouble with a numeric variable.
> >
> > FSEINIT:
> > fdata=open('Streams3','i');
> >
> > INIT:
> > RETURN;
> >
> > MAIN:
> > CONTROL LABEL;
> > if fdata ne 0 then call set(fdata);
> >
> >
> >
> > if watcode ne "" AND SECBEGIN NE. then do;
> > rc=where(fdata,"watcode='"||watcode||"' AND
> > SEBEGIN="||SECBEGIN||""); /* this won't resolve correctly */
> > if fetch(fdata) ne 0 then do;
>
> What are the column names and types in your lookup table Streams3 ?
> What are the column names and types of your fsedit screen ? any
computed
> columns ?
>
> Maybe it's as simple as a typo. Should ...AND SEBEGIN... be ...AND
> SECBEGIN... ?
>
> --
> Richard A. DeVenezia
> http://www.devenezia.com/downloads/sas/actions for SAS Explorer