Date: Mon, 18 Aug 1997 19:44:27 -0400
Reply-To: Anthony Ayiomamitis <ayiomamitis@IBM.NET>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Anthony Ayiomamitis <ayiomamitis@IBM.NET>
Subject: Re: Detecting CHAR/NUM in Data Step
Content-Type: text/plain; charset=us-ascii
Hi Jim,
I did the same thing and still got the same error message. I
contacted the author and he was able to replicate my error and is now
dumb-founded as he can't get the thing to work consistently.
Anthony.
J Hogstad wrote:
>
> Anthony wrote:
>
> "I have run the above example under Windows '95 (Vers 6.11) and it
> will not complete successfully. I get a fatal error ("Undetermined
> execution error detected in the execution of the data step program.
> Aborted during the EXECUTION phase.") with and without the parms
> included. "
>
> I successfully ran the vartype macro after changing the macro name call to
> "vartype" from "vtype" in the data _null_ step with both 6.11 and 6.12
> under Win95.
>
> %MACRO VARTYPE(DSNAME,VNAME);
> %STR(VARTYPE(OPEN("&DSNAME","I"),
> VARNUM (OPEN("&DSNAME","I"),"&VNAME")));
> %MEND VARTYPE;
>
> DATA _NULL_;
> CD_TYPE = %VarTYPE(SASHELP.COMPANY,JOB1);
> DS_TYPE = %VarTYPE(SASHELP.COMPANY,N);
> PUT CD_TYPE= DS_TYPE=;
> RUN;
>
> Jim Hogstad
> e-mail jhogstad@softcom.net
>
> ----------
> > From: Anthony Ayiomamitis <ayiomamitis@ibm.net>
> > Newsgroups: comp.soft-sys.sas
> > Subject: Re: Detecting CHAR/NUM in Data Step
> > Date: Sunday, August 17, 1997 8:41 PM
> >
> > Paul Dorfman wrote:
> > >
> > > Bruce Johnson, in particular, wrote:
> > >
> > > >Is there a way to determine if a variable is character or numeric
> > > >within a datastep? For the purposes of this situation the use of proc
> > > >contents output is prohibited.
> > >
> > > Bruce:
> > >
> > > Anthony Ayiomamitis is right: VARTYPE function has been added to
> > > the list of DATA step functions in Base SAS. Personally, I prefer
> > > to keep a macro like
> > >
> > > %MACRO VARTYPE(DSNAME,VNAME);
> > > %STR(VARTYPE(OPEN("&DSNAME","I"),
> > > VARNUM (OPEN("&DSNAME","I"),"&VNAME")));
> > > %MEND VARTYPE;
> > >
> > > in an autocall library and to use it as a function-like statement
> > > in a data step whenever needed. For instance, in the dataset
> > > SASLIB.VRU the variable CALLDATE is numeric whilst the DUP_STMT is
> > > character. Accordingly, the execution of the above yields:
> > >
> > > 134 DATA _NULL_;
> > > 135 CD_TYPE = %VTYPE(SASLIB.VRU,CALLDATE);
> > > 136 DS_TYPE = %VTYPE(SASLIB.VRU,DUP_STMT);
> > > 137 PUT CD_TYPE= DS_TYPE=;
> > > 138 RUN;
> > >
> > > CD_TYPE=N DS_TYPE=C
> > > NOTE: The DATA statement used 0.05 CPU seconds and 5564K.
> > >
> >
> > Paul,
> >
> > Under what platform and which version of SAS are you using to run
> > the above (please note minor type between the macro name and the macro
> > reference in the data step).
> >
> > I have run the above example under Windows '95 (Vers 6.11) and it
> > will not complete successfully. I get a fatal error ("Undetermined
> > execution error detected in the execution of the data step program.
> > Aborted during the EXECUTION phase.") with and without the parms
> > included.
> >
> > Please don't tell me that SAS macros behave differently between
> > platforms and/or versions of SAS!
> >
> > Anthony.
> >
|