Macro sqpanel

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Macro sqpanel

Hi there,

I have some problems executing the following below in SAS 9.3. I want to produce 6 panels (each variable (=acidtype) 1 panel) with graphs (for 3 days) for 2 datasets, so I've chosen to automate this using a macro. Below is a simplified code for 1 dataset and 2 variables:

 

%macro VFA (dataset=, acidtype=);

proc sgpanel data=&dataset;

panelby dag;

vbox &acidtype;

run;

%mend VFA;

%VFA

(dataset= exp2.vfa_ileum, acidtype= acetic_acid butyric_acid);

 

The problem occuring is the following:

998

999 %VFA

MLOGIC(VFA): Beginning execution.

1000 (dataset= exp2.vfa_ileum, acidtype= acetic_acid . butyric_acid);

MLOGIC(VFA): Parameter DATASET has value exp2.vfa_ileum

MLOGIC(VFA): Parameter ACIDTYPE has value acetic_acid . butyric_acid

SYMBOLGEN: Macro variable DATASET resolves to exp2.vfa_ileum

MPRINT(VFA): proc sgpanel data=exp2.vfa_ileum;

MPRINT(VFA): title "VFA_graphs";

MPRINT(VFA): panelby dag;

SYMBOLGEN: Macro variable ACIDTYPE resolves to acetic_acid . butyric_acid

NOTE: Line generated by the macro variable "ACIDTYPE".

1 acetic_acid . butyric_acid

-

22

200

MPRINT(VFA): vbox acetic_acid . butyric_acid run;

ERROR 22-322: Syntax error, expecting one of the following: ;, /.

ERROR 200-322: The symbol is not recognized and will be ignored.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE SGPANEL used (Total process time):

real time 0.00 seconds

cpu time 0.01 seconds

MLOGIC(VFA): Ending execution.

 

Do one of you have an idea why this syntax error is occuring and how I could prevent it?

Thx in advance!

 


Accepted Solutions
Solution
‎11-09-2016 02:53 PM
Frequent Contributor
Posts: 144

Re: Macro sqpanel

[ Edited ]

Hi,

I thing that the problem is that vbox only allow one numeric parameter. If you want to create that kind of output, use a dataset with vertical format and use other parameter in panelby like PARAM.

 

%macro VFA (dataset=, acidtype=);
proc sgpanel data=&dataset;
panelby dag PARAM;
vbox &acidtype;
run;
%mend VFA;
%VFA (dataset=example, acidtype=Numeric);

View solution in original post


All Replies
Solution
‎11-09-2016 02:53 PM
Frequent Contributor
Posts: 144

Re: Macro sqpanel

[ Edited ]

Hi,

I thing that the problem is that vbox only allow one numeric parameter. If you want to create that kind of output, use a dataset with vertical format and use other parameter in panelby like PARAM.

 

%macro VFA (dataset=, acidtype=);
proc sgpanel data=&dataset;
panelby dag PARAM;
vbox &acidtype;
run;
%mend VFA;
%VFA (dataset=example, acidtype=Numeric);

Super User
Super User
Posts: 7,727

Re: Macro sqpanel

The code you have posted does not match the code in the log, your call:

%VFA

(dataset= exp2.vfa_ileum, acidtype= acetic_acid butyric_acid);

 

Does not match the log's call:

(dataset= exp2.vfa_ileum, acidtype= acetic_acid . butyric_acid);

 

Note particularly the "." between the two acid's.  That is causing your problem.  

Also note that you will not be able to pass through two parameters for vbox like and have it work, syntax for vbox is:

vbox <analysis variable>/options;

Not

vbox <analysis variable> <analysis variable> ... /options;

New Contributor
Posts: 2

Re: Macro sqpanel

Thx a lot for your quick answer guys!

☑ This topic is solved.

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

Discussion stats
  • 3 replies
  • 206 views
  • 0 likes
  • 3 in conversation