Date: Tue, 19 Mar 2002 17:34:49 -0500
Reply-To: Sigurd Hermansen <hermans1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Sigurd Hermansen <hermans1@WESTAT.COM>
Subject: Re: eg functions
SAS does not have double, integer, or single data types, only character and
numeric (floating point). Formatted values display integer appproximations
and strings, as well as dates, times, decimals, etc. (numeric formats) and
different forms of character strings (character formats preceeded by a '$').
SAS also features an informat for inputting data and data conversions.
To convert a value from character to numeric, use the INPUT() function with
an informat [y=INPUT(x,5.)]. To convert from numeric to character, use the
PUT()function with a character (or in some cases a numeric) format [ch=PUT
(c,$<format name>.) or ch=PUT(c,5.)]. Don't forget the period that
terminates the format and distinguishes it from variables.
Also see documentation of special data type conversion functions such as
PUTN(). Note that PUT() and INPUT() can also appear in SQL SELECT lists and
in conditions following WHERE statements, in data step PUT and INPUT
statements, and in PROCS. The PUT() and INPUT() functions and the PUT
statement yield a value but do not in themselves change the values of their
arguments. In C and VB, mutant functions (more accurately, procedures)
change the values of their arguments.
On Tue, 19 Mar 2002 14:05:45 -0500, Kevin Williams
>I joined the newsgroup a couple of months back and left soon after. Now I
am back to try it again.
>Using SAS EG V22.214.171.124 what are the equivalents of the following VB
>1. CDbl(), CInt(), CSng(), CStr() (convert to double, convert to integer,
convert to single, convet to string)
>2. InStr() (search for string within a string)
>3. Mid() (extract n number of characters from within a string)
>The help file was very scarce on non proc/coding information and I am no
statistician. I simply need access to host info and SAS is the format in
which it is preseneted to me.
>Thanks for any and all help.
>... and respectfully, no consultant calls please