|Date: ||Fri, 31 Oct 2003 09:41:57 -0000|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Ben Powell <Ben.powell@CLA.CO.UK>|
|Subject: ||Re: SAS code to C code?|
|Content-Type: ||text/plain; charset="us-ascii"|
I've tried a few times to learn C and not managed it yet. Though it
remains an ambition to at least be able to code something useful. For me
it normally requires the need first before I can motivate myself to
learn how to do it, and as yet I haven't had a strong enough requirement
If you already know SAS and are trying to translate, as I suggested was
the more reasonable possibility, a simple piece of SAS code into C then
try asking one of the gurus on the list more directly, if there is
something specific you want to translate.
Alternatively there is a section in Susan Slaughter's book The Little
SAS Book 2nd Edition where she compares the built in functionality of
SAS to C. She translates this code to C++:
INPUT Name $ Age GPA;
PROC PRINT DATA = grades;
The equivalent C code covers more than 30 lines and the output is not as
I don't know whether the R system will allow you to review the source
code. This might also give you some clues.
As far as practicality goes for stats and data manipulation particularly
however, I'd stick with SAS.
From: Yang, Kai [mailto:Kai.Yang@cshs.org]
Sent: 30 October 2003 17:51
To: 'Ben Powell'
Subject: RE: SAS code to C code?
I just want to learn C. I want to know how does C work as same as SAS in
data step and IML if we have a easy way to do that. thank you Kai
> From: Ben Powell[SMTP:ben.powell@CLA.CO.UK]
> Reply To: Ben Powell
> Sent: Thursday, October 30, 2003 7:09 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: SAS code to C code?
> This question comes up once in a while. I can only assume the
> anticipated application is very limited, such as the equivalent of a
> single datastep or proc. If it was to be run several times a day for
> several years on large volumes then considering coding something in C
> might be worthwhile. BUT, given SAS is itself coded in C, I don't
> really see the point? Unless the project is simply unworkable in SAS -
> highly unlikely - why would you think
> your C code could out perform SAS Institute's? It would be like me
> out and attempting to translate Oracle 10g database into C. Biting off
> than I could chew.
> So, I think the question should be phrased more directly. Is it as
> suggested above a requirement for one simple step to be translated?
> Kinda fun, have a go sort of experiment. Might be a good exercise for
> a C student. Or is it a replacement for SAS? If the latter, I suggest
> the first C app you build is one to compute the man hours of
> development time you are
> up against, and a second to compute the economies involved.
> Or else the answer is no.
> -----Original Message-----
> From: Yang, Kai [mailto:Kai.Yang@CSHS.ORG]
> Sent: Wednesday, October 29, 2003 19:43
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: SAS code to C code?
> Is there a way to translate the SAS code to C code?
> Thank you