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 (October 2003, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 31 Oct 2003 09:41:57 -0000
Reply-To:     ben.powell@cla.co.uk
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ben Powell <Ben.powell@CLA.CO.UK>
Organization: cla
Subject:      Re: SAS code to C code?
Comments: To: "Yang, Kai" <Kai.Yang@cshs.org>
In-Reply-To:  <3CFAA0108952D111A5BF00805FA6FB0F05B6035B@PEDSNTAS.csmc.edu>
Content-Type: text/plain; charset="us-ascii"

Kai,

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 to learn!

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++:

DATA grades; INFILE 'c:\MyRawData\gpa.dat'; INPUT Name $ Age GPA; PROC PRINT DATA = grades; RUN;

The equivalent C code covers more than 30 lines and the output is not as rich.

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.

HTH.

-----Original Message----- From: Yang, Kai [mailto:Kai.Yang@cshs.org] Sent: 30 October 2003 17:51 To: 'Ben Powell' Subject: RE: SAS code to C code?

Hi, Ben: 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 going > out and attempting to translate Oracle 10g database into C. Biting off > more > 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. > > HTH > > -----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? > > > Hello, > Is there a way to translate the SAS code to C code? > Thank you > Kai > > ------------------------------ >


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