Hemken / SASmarkdown

A collection of R functions that extends knitr's capability for using SAS as a language engine
Other
21 stars 5 forks source link

collectcode doesn't work with sashtml5 engine #24

Closed qdread closed 1 year ago

qdread commented 1 year ago

Hi, thanks for the great package! I will preface this by saying I am a newb at SASmarkdown, and to some extent also SAS. Apologies in advance if this has a simple solution, but I was unable to find it in the documentation.

The issue is that for some reason the collectcode = TRUE argument works for some SAS engines, not others. I have been able to successfully get it to work using the sas and sashtml engines, but not sashtml5. Is this expected behavior?

For reference I am working with Windows 10 x64, R 4.2.2, and SASmarkdown 0.8.0.

Example .Rmd is below. It returns an error that WORK.POWER_EXAMPLE_1 is not found if using sashtml5, but works as expected if using sas or sashtml engine.

Thanks in advance for your help!

```{r setup, include = FALSE}
library(SASmarkdown)
data power_example_1;
  input trt mu;
  do obs = 1 to 5;
    output;
  end;
datalines;
0 20
1 25
2 25
;

blah blah

proc glimmix data = power_example_1;
  class trt;
  model mu = trt;
  parms (9) / hold = 1;
  contrast 'control vs experimental' trt 2 -1 -1;
  contrast 'control vs experimental 1' trt 1 -1;
  contrast 'control vs experimental 2' trt 1 0 -1;
  contrast 'experimental 1 vs experimental 2' trt 0 1 -1;
  lsmeans trt / diff cl;
  ods output tests3 = F_overall contrasts = F_contrasts;
run;
Hemken commented 1 year ago

I'll have a look, but won't be able to get to a computer for a few days.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Quentin Read @.> Sent: Tuesday, January 31, 2023 9:11:09 AM To: Hemken/SASmarkdown @.> Cc: Subscribed @.***> Subject: [Hemken/SASmarkdown] collectcode doesn't work with sashtml5 engine (Issue #24)

Hi, thanks for the great package! I will preface this by saying I am a newb at SASmarkdown, and to some extent also SAS. Apologies in advance if this has a simple solution, but I was unable to find it in the documentation.

The issue is that for some reason the collectcode = TRUE argument works for some SAS engines, not others. I have been able to successfully get it to work using the sas and sashtml engines, but not sashtml5. Is this expected behavior?

For reference I am working with Windows 10 x64, R 4.2.2, and SASmarkdown 0.8.0.

Example .Rmd is below. It returns an error that WORK.POWER_EXAMPLE_1 is not found if using sashtml5, but works as expected if using sas or sashtml engine.

Thanks in advance for your help!

library(SASmarkdown)
data power_example_1;
  input trt mu;
  do obs = 1 to 5;
    output;
  end;
datalines;
0 20
1 25
2 25
;

blah blah

proc glimmix data = power_example_1;
  class trt;
  model mu = trt;
  parms (9) / hold = 1;
  contrast 'control vs experimental' trt 2 -1 -1;
  contrast 'control vs experimental 1' trt 1 -1;
  contrast 'control vs experimental 2' trt 1 0 -1;
  contrast 'experimental 1 vs experimental 2' trt 0 1 -1;
  lsmeans trt / diff cl;
  ods output tests3 = F_overall contrasts = F_contrasts;
run;

— Reply to this email directly, view it on GitHubhttps://github.com/Hemken/SASmarkdown/issues/24, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME66QBR72E3GZXIQQDTWVE2R3ANCNFSM6AAAAAAUMUA6UM. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Hemken commented 1 year ago

Thanks for the report. I’ll post a fix here today, and submit it to CRAN as well.

A workaround would be to use the sas or sashtml engine for your DATA step chunk. I guess I tend to use the plain sas engine when I’m setting up data, which may be why I missed this? In any event, it will be fixed soon.

-- Doug Hemken SSCC statistical consultant 4226i Social Science Bldg.

@.**@.> 608-262-4327

From: Quentin Read @.> Sent: Tuesday, January 31, 2023 10:11 AM To: Hemken/SASmarkdown @.> Cc: Subscribed @.***> Subject: [Hemken/SASmarkdown] collectcode doesn't work with sashtml5 engine (Issue #24)

Hi, thanks for the great package! I will preface this by saying I am a newb at SASmarkdown, and to some extent also SAS. Apologies in advance if this has a simple solution, but I was unable to find it in the documentation.

The issue is that for some reason the collectcode = TRUE argument works for some SAS engines, not others. I have been able to successfully get it to work using the sas and sashtml engines, but not sashtml5. Is this expected behavior?

For reference I am working with Windows 10 x64, R 4.2.2, and SASmarkdown 0.8.0.

Example .Rmd is below. It returns an error that WORK.POWER_EXAMPLE_1 is not found if using sashtml5, but works as expected if using sas or sashtml engine.

Thanks in advance for your help!


library(SASmarkdown)

data power_example_1;

  input trt mu;

  do obs = 1 to 5;

    output;

  end;

datalines;

0 20

1 25

2 25

;

blah blah


proc glimmix data = power_example_1;

  class trt;

  model mu = trt;

  parms (9) / hold = 1;

  contrast 'control vs experimental' trt 2 -1 -1;

  contrast 'control vs experimental 1' trt 1 -1;

  contrast 'control vs experimental 2' trt 1 0 -1;

  contrast 'experimental 1 vs experimental 2' trt 0 1 -1;

  lsmeans trt / diff cl;

  ods output tests3 = F_overall contrasts = F_contrasts;

run;

— Reply to this email directly, view it on GitHubhttps://github.com/Hemken/SASmarkdown/issues/24, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME66QBR72E3GZXIQQDTWVE2R3ANCNFSM6AAAAAAUMUA6UM. You are receiving this because you are subscribed to this thread.Message ID: @.***>

qdread commented 1 year ago

The main reason I wanted to enable collectcode=TRUE when using the sashtml5 engine was to use a store statement to save the results of a model to use in a later code chunk, while also displaying html5 output. But that is a good workaround for the data step. Thanks for looking into it!

Hemken commented 1 year ago

Published here. And also on CRAN.

Hemken commented 1 year ago

Now on CRAN

-- Doug Hemken SSCC statistical consultant 4226i Social Science Bldg.

@.**@.> 608-262-4327

From: Quentin Read @.> Sent: Friday, February 3, 2023 10:40 AM To: Hemken/SASmarkdown @.> Cc: Doug Hemken @.>; Comment @.> Subject: Re: [Hemken/SASmarkdown] collectcode doesn't work with sashtml5 engine (Issue #24)

The main reason I wanted to enable collectcode=TRUE when using the sashtml5 engine was to use a store statement to save the results of a model to use in a later code chunk, while also displaying html5 output. But that is a good workaround for the data step. Thanks for looking into it!

— Reply to this email directly, view it on GitHubhttps://github.com/Hemken/SASmarkdown/issues/24#issuecomment-1416119309, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME2VBY2LIWW4JXQZ4PTWVUYHJANCNFSM6AAAAAAUMUA6UM. You are receiving this because you commented.Message ID: @.***>