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 (March 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Kevin Williams <Kevin.Williams@FIRSTMERIT.COM>

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.

Sig On Tue, 19 Mar 2002 14:05:45 -0500, Kevin Williams <Kevin.Williams@FIRSTMERIT.COM> wrote:

>Hi all; > >I joined the newsgroup a couple of months back and left soon after. Now I am back to try it again. > >Using SAS EG V1.2.0.242 what are the equivalents of the following VB functions > >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 > >Thanks >Kevin


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