Date: Fri, 22 Oct 2004 08:48:29 -0400
Reply-To: "Fehd, Ronald J." <RJF2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J." <RJF2@CDC.GOV>
Subject: Re: Generate Dynamic Excel Worksheets from a PDS.
Content-Type: text/plain; charset="us-ascii"
> From: KHANNA NARRAVULA
> Thanks to everyone. Just changed filename statement
> to dquotes, and it worked fine.
good, you're coming up to speed in using macros, then.
> I like to do some refinements to this program.
>
> Firstly, is it possible to generate dynamic INPUT statement.
> Since, the members within PDS can have a different record
> structure, i want to prepare a dynamic input depending upon
> 4-7th character of the member name.
>
> So, when i coded this, i'm getting the error 'A character
> operand was found in the %EVAL function or %IF condition
> where a numeric operand is required'.
you are using a SAS data step function as argument
to the macro language
this is known as 'mixing and knot matching'
> %macro exm;
> %do i=1 %to &count;
> filename in1 "AV76762.IEBV2.OUTPUT(&&mem&i)";
> DATA EXTERNAL;
> INFILE IN1;
*simplified logic:
INPUT sno 1-2 memno $4-12 status $15-21 %*always;
> %if %substr(&&mem,4,4) ne 1385 %then %do;
%*........^..................^^;
gsam $24 reason $27-37 %end;
;%*closure of input
> %end;
> %mend;
> Secondly, instead of having sno field in the input field, i can use
> OBS to generate the seqeuence number. But while i do like that, my
> field name will be 'OBS'. Is it possible to change the field
> name to our own name like in this case as 'sno'.
yes, you did that.
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
Your task is simple: remove the difference
between how things should be
and how they really are.
-- Ashleigh Brilliant pot-shot #4247