09-22-2015 11:15 AM
I am trying to add unique titles to my outputs for proc means and proc univariate results, but the only way I know how to do this is through the insertion of a macro variable which can only be one word. I could use "_" but it needs to be cleaner. Anyone know of a way to create unique titles within a macro process?
What I have so far looks like this:
j k l
m n o
p q r
%do i=1 %to 3;
%let v = %scan(&varA, &i.);
%let t = %scan(&varB, &i.);
proc means data=test; (another similar program with proc univariate as well)
What it does for the title 2 is prints one word for each instead of the whole line. I have tried adding in quotations but then it runs with an error because it picks up the first word with one quotation mark.
Any help would be great thanks.
09-22-2015 12:11 PM
09-22-2015 11:33 AM
but the only way I know how to do this is through the insertion of a macro variable which can only be one wordMacro variables can be as many words as you want them to be. So I don't understand this limitation you are stating.
What it does for the title 2 is prints one word for each instead of the whole line.This also makes no sense to me. Can you give us an example of what title you would actually like to see?
09-22-2015 11:43 AM
Okay, what I meant was what is stored only seems to be taking on one word values. For example, I want two titles in my output. The first title as the variable's name, and the second title as a description of that variable. So for the macro variable varA I store the variable name, and for the macro variable varB I want to store the variable description but I don't know the syntax for creating a macro variable that calls multiple words.
09-22-2015 12:07 PM - edited 09-22-2015 12:08 PM
I do not understand why you have all that macro code? Post some have and some want so its easier to see. Anyways, SAS have specific caommands for dealing with this type of thing, its called by var processing. First get your data into a normalised structure, its far easier to work with, and you can use by group processing - note its also CDISC standard.
dataset have looks like:
parameter result idvar
A 5 01
A 6 02
B 3 01
now I can just do:
proc means data=have;
proc report data=want nowd;
title1 "This is the title for parameter = #byvar(parameter)";
So much simpler, no macro code. Examples:
09-22-2015 12:11 PM
Need further help from the community? Please ask a new question.