Learning SAS? Welcome to the exclusive online community for all SAS learners.

No results being generated despite no Errors??

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

No results being generated despite no Errors??

Hi there,

I am running a marco (Mixtran macro from the national cancer institute- http://epi.grants.cancer.gov/diet/usualintakes/mixtran_macro_v2.1.sas).

My libname statement works- the log says "kenyaD was successfully assigned".

My % include statement seems to work and even when I enter the macro's syntax I get no Error messages at all but I still don't get any results being generated? I am very confused?

Below is my log and code but the results tab is empty.

Please help!

Here is my code:

libname kenyaD '/folders/myfolders/';

%include "/folders/myfolders/mixtran_macro_v2.1.sas";

%macro MIXTRAN

(data=kenyaD, response=CA, foodtype=CA, subject=ID, repeat=visitno, covars_prob=sex agey, covars_amt=sex agey,

outlib=kenyaD, modeltype=amount, lambda=, replicate_var=, seq=, weekend=, vargroup=,

numvargroups=, start_val1=, start_val2=, start_val3=, vcontrol=,

nloptions=, titles=, printlevel=,subgroup=);

And here is my log:

1 OPTIONS NOSYNTAXCHECK;

2 TITLE;

3 FOOTNOTE;

4 OPTIONS LOCALE=en_US DFLANG=LOCALE;

5 DATA _NULL_;

6 RUN;

NOTE: DATA statement used (Total process time):

  real time 0.00 seconds

  cpu time 0.01 seconds

  

7 OPTIONS VALIDVARNAME=V7;

8 FILENAME _HTMLOUT TEMP;

9 FILENAME _RTFOUT TEMP ENCODING='UTF-8';

10 FILENAME _PDFOUT TEMP;

11 FILENAME _GSFNAME TEMP;

12 FILENAME _DATAOUT TEMP;

13 %LET SYSCC=0;

14 %LET _CLIENTAPP=SAS Studio;

15 %LET _CLIENTAPPVERSION=3.4;

16 %LET _SASPROGRAMFILE = %BQUOTE();

17 %LET _BASEURL = %BQUOTE(http://localhost:10080/SASStudio/);

18 %LET _EXECENV=SASStudio;

19 DATA _NULL_;

20 CALL SYMPUT("GRAPHINIT","");

21 CALL SYMPUT("GRAPHTERM","");

22 RC=TSLVL('GEOCODE','N');

23 _ERROR_=0;

24 IF (RC^=' ') THEN DO;

25 CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");

26 CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;");

27 END;

28 RUN;

NOTE: DATA statement used (Total process time):

  real time 0.01 seconds

  cpu time 0.02 seconds

  

29 DATA _NULL_;

30 RC=SYSPROD("PRODNUM002");

31 IF (RC^=1) THEN DO;

32 CALL SYMPUT("GRAPHINIT","");

33 CALL SYMPUT("GRAPHTERM","");

34 END;

35 RUN;

NOTE: DATA statement used (Total process time):

  real time 0.01 seconds

  cpu time 0.01 seconds

  

36 %LET _DATAOUT_MIME_TYPE=;

37 %LET _DATAOUT_NAME=;

38 %LET _DATAOUT_TABLE=;

39 %LET _DATAOUT_URL=;

40 %SYMDEL _DATAOUT_MIME_TYPE _DATAOUT_NAME _DATAOUT_URL _DATAOUT_TABLE;

41 %LET _SASWS_ = %BQUOTE(/folders/myfolders);

42 %LET _SASWSTEMP_=%BQUOTE(/folders/myfolders/.images/477ffadc-26ca-415d-9b08-c608a89cee39);

43 ODS LISTING CLOSE;

44 OPTIONS PRINTERPATH=PDF;

45 ODS AUTONAVIGATE OFF;

46 ODS GRAPHICS ON;

47 ODS HTML5 (ID=WEB) DEVICE=PNG GPATH="&_SASWSTEMP_" ENCODING=utf8 FILE=_HTMLOUT (TITLE='Results: Program 1')

47 ! STYLE=Htmlblue OPTIONS(BITMAP_MODE='INLINE' SVG_MODE='INLINE' CSS_PREFIX='.ods_477ffadc-26ca-415d-9b08-c608a89cee39'

47 ! BODY_ID='div_477ffadc-26ca-415d-9b08-c608a89cee39' );

NOTE: Writing HTML5(WEB) Body file: _HTMLOUT

48 ODS RTF (ID=WEB) STYLE=Rtf FILE=_RTFOUT;

NOTE: Writing RTF Body file: _RTFOUT

49 ODS PDF (ID=WEB) STYLE=Pearl FILE=_PDFOUT;

NOTE: Writing ODS PDF(WEB) output to DISK destination "_PDFOUT", printer "PDF".

50 &GRAPHINIT;

51 OPTIONS FIRSTOBS=1;

52 OPTIONS OBS=MAX;

53 OPTIONS DTRESET DATE NUMBER NOTES;

54 OPTIONS NOSYNTAXCHECK;

55 

56 %macro MIXTRAN

57 (data=kenyaD, response=CA, foodtype=CA, subject=ID, repeat=visitno, covars_prob=sex agey, covars_amt=sex agey,

58 outlib=kenyaD, modeltype=amount, lambda=, replicate_var=, seq=, weekend=, vargroup=,

59 numvargroups=, start_val1=, start_val2=, start_val3=, vcontrol=,

60 nloptions=, titles=, printlevel=,subgroup=);

61 

62 OPTIONS NOSYNTAXCHECK;

63 ODS HTML CLOSE;

64 &GRAPHTERM; ;*';*";*/;RUN;QUIT;

65 QUIT;RUN;

66 ODS HTML5 (ID=WEB) CLOSE;

67 

68 ODS RTF (ID=WEB) CLOSE;

69 ODS PDF (ID=WEB) CLOSE;

70 FILENAME _GSFNAME;

71 DATA _NULL_;

72 RUN;

73 OPTIONS NOTES STIMER SOURCE SYNTAXCHECK;

74 


Accepted Solutions
Solution
‎08-18-2015 09:43 PM
Super User
Posts: 17,912

Re: No results being generated despite no Errors??

You're calling the macro incorrectly, not %macro in the name.

You may need to restart SAS as this may generate a system error as SAS is now expecting a %mend and possibly other syntax.

%mixtran(parameter list);

View solution in original post


All Replies
Solution
‎08-18-2015 09:43 PM
Super User
Posts: 17,912

Re: No results being generated despite no Errors??

You're calling the macro incorrectly, not %macro in the name.

You may need to restart SAS as this may generate a system error as SAS is now expecting a %mend and possibly other syntax.

%mixtran(parameter list);

Occasional Contributor
Posts: 14

Re: No results being generated despite no Errors??

Hi,

Thank you, that worked! The only problem is now I do get Error messages. It now says " ERROR: File WORK.KENYAD.DATA does not exist."

I don't understand because the files does exist. The first 2 lines of code run successfully it is only once I run the %MIXTRAN statement that the errors occur.

Any help is appreciated!!!

Below is the code used:

libname kenyaD '/folders/myfolders/';

%include "/folders/myfolders/mixtran_macro_v2.1.sas";

%MIXTRAN(data=kenyaD, response=CA, foodtype=CA, subject=ID, repeat=visitno, covars_prob=sex agey, covars_amt=sex agey,

outlib=kenyaD, modeltype=amount, lambda=, replicate_var=, seq=, weekend=, vargroup=,

numvargroups=, start_val1=, start_val2=, start_val3=, vcontrol=,

nloptions=, titles=, printlevel=,subgroup=);

Super User
Posts: 17,912

Re: No results being generated despite no Errors??

You've assigned a library named KenyaD, where exactly is the data set? I its in KenyaD you need to refer to it as KenyaD.KenyaD

In general you refer to a data set as LIBNAME.DATA_SET_NAME except in the case where the libname is WORK and then you can omit it.

Super User
Posts: 6,964

Re: No results being generated despite no Errors??

This:

libname kenyaD '/folders/myfolders/';

assigns a library reference to a physical directory. This works as long as the directory exists and you have at least read permission for this directory.

Your macro seems to somewhere use the reference &data as an input dataset, and as it receives a one-level name (without a dot somewhere), it automatically prepends WORK. and therefore looks for WORK.KENYAD, which, quite obviously, does not exist.

So the question is, is there a SAS dataset in /folders/myfolders? And is it supposed to be the input dataset for whatever the macro does?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 14

Re: No results being generated despite no Errors??

Yes, there is a SAS dataset in myfolders. the file name is currently Kdata.sas7bdat. should this simply be saved in myfolder i.e.  /folders/myfolders/Kdata.sas7bdat   or should it be saved in /folders/myfolders/kenyaD/Kdata.sas7bdat.

Even when I try running it with data= kenyaD.Kdata I get the same error??

Super User
Posts: 17,912

Re: No results being generated despite no Errors??

Make sure to restart SAS as errors may be lingering and modify your %mixtran call. Post your macro call and the corresponding error in the log as well.

Kenyad.Kdata should work unless the macro was designed to work with a data set in the work library. You can try copying it over and then calling the macro as well.

data kdata;

set kenyad.kdata;

run;

Occasional Contributor
Posts: 14

Re: No results being generated despite no Errors??

Hi Reeza,

Thank you for all your help.  using the

data kdata;

set kenyad.kdata;

run;

seemed to work, as it pulled up the data set under the "Output Data" tab.

However, I now I get the following errors:

"ERROR: File WORK.BOXCOX.DATA does not exist."

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,

ERROR: Variable BOXCOXY not found.

ERROR: File WORK.PARMSG2.DATA does not exist.

22: LINE and COLUMN cannot be determined.

ERROR: File WORK.CONVF2.DATA does not exist.

I am not sure what "BOXCOXY", "PARMSG2" and "CONVF2" are? I don't have any data using these names?

Super User
Posts: 17,912

Re: No results being generated despite no Errors??

That's an issue within the macro or exactly how you're calling it.

I think you'll have to learn how to debug it from here, as without the actual data it would be difficult.

New Contributor
Posts: 2

Re: No results being generated despite no Errors??

I met the same problem you had.

 

You can add a line 

 

ods graphics off;

 

before the marco.

 

The code work finally.

Super User
Posts: 6,964

Re: No results being generated despite no Errors??

%macro starts a macro definition, to call the macro, just use %mixtran(),

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 10 replies
  • 1280 views
  • 3 likes
  • 4 in conversation