|
LAB BENELUX BV wrote:
>
> I don't know how to get a object-value in SAS-AF in an dataset.
> Example : I have a text object and I want to transport the textvalue
> to a datasetvariable.
>
> Peter de Mooy
> LAB@TIP.NL
Step 1. Read the SCL manual sections on Open, Close, Fetch, Fetchobs,
Getvarn, Varnum, Update, Append, Set, etc. etc. etc.
Step 2.
The following example code creates a SAS dataset with one char and one
numeric variable set from SCL variables.
/* create new dataset */
ds_id = open('work.newdata','N') ;
rc = newvar(ds_id,'CHARVAL','c',8) ;
rc = newvar(ds_id,'NUMVAL','n',8) ;
call close(ds_id) ;
/* NOW OPEN IT FOR UPDATE */
ds_id = open('work.newdata','U') ;
/* write first record */
rc = append(ds_id) ;
/* Set new values to dataset */
call putvarn(ds_id,varnum(ds_id,'NUMVAL'),sclnumvar) ;
call putvarc(ds_id,varnum(ds_id,'CHARVAL'),sclcharvar) ;
rc = update(ds_id) ;
call close(ds_id) ;
HTH
Bruce
|