I'm still stucked with SAS special characters treatment.
%macro mFormat();
%do i=1 %to &numVar. ;
proc format library = work ;
invalue $ inf&&nomVar&i..s
%do j=1 %to &&numMod&i.;
"%superq(tb&i.mod&j.)" = &j.
%end;
;
run;
proc format library = work ;
value f&&nomVar&i..s
%do k=1 %to &&numMod&i.;
&k. = "%superq(tb&i.mod&k.)"
%end;
;
run;
%end;
%mend mFormat;
%mFormat();
As you can see, the program supposes to create the format and the informats for each variable. My only problem is when the variable name resolves to Brand which contains
GOTAN-GOTAN
FRANCES-FRANCES
+&DECO-+DECO&
etc ...
These names leads me to this error
“ERROR: This range is repeated, or values overlap:”
I hope I can force SAS to read those names. Or perhaps, this is not the best approach to generate FORMATS and INFORMATS for variables that contain these characters( &, %, -, ', ").
proc format
. I don't know whether it is valid. Acutually value statements ofproc format
can be generated by macro. Please correct me if I understand in a wrong way. – Robbie Liu