Re: Executing SAS Codes in R

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Executing SAS Codes in R

Peter Maclean
Is there a way of executing SAS codes in R environment?

 
Peter Maclean
Department of Economics
UDSM
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Executing SAS Codes in R

Bert Gunter
I certainly hope not!

There are of course many resources on "R for SAS users" and the like.

-- Bert

On Wed, Nov 7, 2012 at 10:24 AM, Peter Maclean <[hidden email]> wrote:

> Is there a way of executing SAS codes in R environment?
>
>
> Peter Maclean
> Department of Economics
> UDSM
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



--

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Executing SAS Codes in R

Nordlund, Dan (DSHS/RDA)
In reply to this post by Peter Maclean
> -----Original Message-----
> From: [hidden email] [mailto:r-help-bounces@r-
> project.org] On Behalf Of Peter Maclean
> Sent: Wednesday, November 07, 2012 10:25 AM
> To: R mailing list
> Subject: Re: [R] Executing SAS Codes in R
>
> Is there a way of executing SAS codes in R environment?
>
>
> Peter Maclean
> Department of Economics
> UDSM
> [[alternative HTML version deleted]]


Peter,

I think you will need to clarify what you are trying to do before you will get much useable help.  Obviously, R will not run SAS programs/scripts.  If you are asking if R can call SAS and have SAS run SAS code, then the answer is yes.  There are other options for different levels of integration in between.  So, what is it that you wish to accomplish?

Dan

Daniel Nordlund
Olympia, WA 98504-5204


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Executing SAS Codes in R

Peter Dalgaard-2
In reply to this post by Bert Gunter

On Nov 7, 2012, at 19:34 , Bert Gunter wrote:

> I certainly hope not!

fortune("reverse the procedure")

>
> There are of course many resources on "R for SAS users" and the like.
>
> -- Bert
>
> On Wed, Nov 7, 2012 at 10:24 AM, Peter Maclean <[hidden email]> wrote:
>> Is there a way of executing SAS codes in R environment?
>>
>>
>> Peter Maclean
>> Department of Economics
>> UDSM
>>        [[alternative HTML version deleted]]
>>
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>
> --
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
>
> Internal Contact Info:
> Phone: 467-7374
> Website:
> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: [hidden email]  Priv: [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Executing SAS Codes in R

David Winsemius
In reply to this post by Bert Gunter

On Nov 7, 2012, at 10:34 AM, Bert Gunter wrote:

> I certainly hope not!
>
> There are of course many resources on "R for SAS users" and the like.

One could even think of R-help as a distributed support group for recovering-SAS-users.


>
> -- Bert
>
> On Wed, Nov 7, 2012 at 10:24 AM, Peter Maclean <[hidden email]> wrote:
>> Is there a way of executing SAS codes in R environment?
>>
>>
>> Peter Maclean
>> Department of Economics
>> UDSM
>>        [[alternative HTML version deleted]]


David Winsemius, MD
Alameda, CA, USA

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Executing SAS Codes in R

Rolf Turner-3
In reply to this post by Peter Dalgaard-2
On 08/11/12 09:09, peter dalgaard wrote:
> On Nov 7, 2012, at 19:34 , Bert Gunter wrote:
>
>> I certainly hope not!
> fortune("reverse the procedure")
>

See also fortune("SAS to R parser").

     cheers,

         Rolf

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Executing SAS Codes in R

Ista Zahn
On Wed, Nov 7, 2012 at 4:03 PM, Rolf Turner <[hidden email]> wrote:

> On 08/11/12 09:09, peter dalgaard wrote:
>>
>> On Nov 7, 2012, at 19:34 , Bert Gunter wrote:
>>
>>> I certainly hope not!
>>
>> fortune("reverse the procedure")
>>
>
> See also fortune("SAS to R parser").

Yes, all delightful and amusing! But perhaps the OP is looking for
something as simple as

system("sas -SYSIN path/to/sas/script.sas")

Peter M., is that what you were after (calling SAS from R) or are you
really looking to evaluate SAS code inside R?

Best,
Ista

>
>     cheers,
>
>         Rolf
>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Executing SAS Codes in R

Peter Maclean
In reply to this post by Peter Maclean
The answer I got from my previous questions suggeted how to read SAS data into R. That was not the question. I want to execute/evaluate SAS code inside R environment. I have SAS data and SAS codes but I have no access to SAS software. In my study, I want to replicate everything defined by the SAS code. 


Peter Maclean
Department of Economics
UDSM
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Executing SAS Codes in R

John Kane
Perhaps http://www.statmethods.net/  or google for "R for SAS and SPSS users"

John Kane
Kingston ON Canada


> -----Original Message-----
> From: [hidden email]
> Sent: Thu, 8 Nov 2012 07:09:39 -0800 (PST)
> To: [hidden email]
> Subject: Re: [R] Executing SAS Codes in R
>
> The answer I got from my previous questions suggeted how to read SAS data
> into R. That was not the question. I want to execute/evaluate SAS code
> inside R environment. I have SAS data and SAS codes but I have no access
> to SAS software. In my study, I want to replicate everything defined by
> the SAS code.
>
>
> Peter Maclean
> Department of Economics
> UDSM
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Executing SAS Codes in R

Marc Schwartz-3
In reply to this post by Peter Maclean
On Nov 8, 2012, at 9:09 AM, Peter Maclean <[hidden email]> wrote:

> The answer I got from my previous questions suggeted how to read SAS data into R. That was not the question. I want to execute/evaluate SAS code inside R environment. I have SAS data and SAS codes but I have no access to SAS software. In my study, I want to replicate everything defined by the SAS code.



The answer to running SAS code inside R was answered, with a pretty clear no:

  https://stat.ethz.ch/pipermail/r-help/2012-November/328405.html

The other responses were generally tongue in cheek responses pertaining to the above inability (eg. You can run SAS code in R by reversing the way in which you run R code in SAS).

You can call SAS from within R by using the system() command as was noted in one reply and SAS has an ability to run R from within a SAS session via a similar method of executing an external program, but they do not natively interpret and execute the other language.

If you are looking to **translate** your SAS code to R code, so that you can accomplish similar analyses in R, then you should be looking at a reference such as:

R for SAS and SPSS Users
by Bob Muenchen
http://www.amazon.com/SAS-SPSS-Users-Statistics-Computing/dp/0387094172

I am not sure that I saw a definitive response to reading SAS datasets into R, but a more recent option, which is based upon a reverse engineering of the SAS data set structure would be Matt Shotwell's sas7bdat CRAN package:

  http://cran.r-project.org/web/packages/sas7bdat/index.html


Regards,

Marc Schwartz

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.