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 (October 1996, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 1 Oct 1996 12:56:46 -0700
Reply-To:   gxx18300@ggr.co.uk
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Bruce Rogers <gxx18300@GGR.CO.UK>
Organization:   Medical IR, Glaxo Wellcome
Subject:   Re: How can I get the value of an SAS-AF object in a dataset ?
Comments:   To: LAB BENELUX BV <LAB@TIP.NL>

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


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