Date: Tue, 8 Feb 2000 15:06:07 -0500
Reply-To: WHITLOI1 <WHITLOI1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: WHITLOI1 <WHITLOI1@WESTAT.COM>
Subject: Re: Any Way To Reference Multiple _INFILE_s?
Content-Type: text/plain; charset=US-ASCII
Don,
In version 6.12 I don't see how you could copy _INFILE_ to a macro variable. If
you
had a long macro variables I think RESOLVE with the %SUBSTR macro function would
be necessary to get it back in pieces within one DATA step.
In version 8, it is a triviality using the _INFILE_ option of the INFILE
statement to copy the input record to an automatic variable.
Ian Whitlock <whitloi1@westat.com>
____________________Reply Separator____________________
Subject: Re: Any Way To Reference Multiple _INFILE_s?
Author: Don Stanley <don_stanley@XTRA.CO.NZ>
Date: 2/9/2000 7:51 AM
I think you've all missed the real question. Theo wanted to access _infile_ for
each
infile he has, and not lose the information retained in a prior one. Th eanswer
I
believe is no, unless you can copy _infile_ to a macro variable then use SYMGET
to
re-use in same step -- haven't tried this.
Don
Peter Crawford wrote:
> A data step can input from more than one infile, Each input statement reads
from
> the infile statement refered to most recently.
> The following step (has been tested) might give some idea of this.
> data;
> infile ddnam1 truncover /* etc */ ;
> input from first infile ddnam1 @;
> infile ddnam2 lrecl=1000 dsd dlm=' ' missover /* etc */;
> input somefrom second infil ddnam2 ;
> infile ddnam1 /* options for ddnam1 still apply */ ;
> input moreFrom ddnam1 /*held*/ input record;
> infile ddnam2 ;
> input next record fields from ddnam2 ;
> run;
>
> To dynamically (at run time) define the external file name to use for the
> infile, use the infile option FILEVAR=, Being dynamic it gets more
complex.....
>
> Datum: 08.02.2000 15:17
> An: SAS-L@listserv.uga.edu
>
> Antwort an: theodp@aol.com
>
> Betreff: Any Way To Reference Multiple _INFILE_s?
> Nachrichtentext:
>
> Is there any way to refer to multiple _INFILE_s (e.g., by DDNAME) in a single
> data step, or does each INPUT destroy the prior one?
>
> Any changes under V8?
--
Don Stanley, B.SC, Dip O.R.S, MNZCS Director, Sysware Consulting Group
Box 634, Wellington, NEW ZEALAND
http://www.sysware.co.nz
EMAIL:: don_stanley@xtra.co.nz
http://www.geocities.com/don_stanley_nz/don_home.htm
Genealogy:: http://www.geocities.com/don_stanley_nz/family.htm