I find that it is MUCH easier to use the PUT statement to generate code than to try and build it into strings. I also find it much easier to use temporary files rather than source catalogs for code generation. You can look at them much easier and use them in more places. I like to limit my line lengths to < 80 (really 72) so that both me and the computer can read the code more easily. Here is a version of your program that is more "SASified". filename compfile temp; *filename compfile catalog 'work.tmp.compfile.source'; data _null_; file compfile lrecl=500; do i=1 to 25 ; put 'compute _' i z2. ';' / 'if not notupper(substr(_' i z2. ',1,1)) then' / ' call define (_col_,"style","style=[BACKGROUND=#A6CE39 FONT_WEIGHT=BOLD]")' / ';' / 'else call define (_col_,"style","style=[BACKGROUND=#A9A9A9 FONT_WEIGHT=BOLD]");' / "if substr(_" i z2. ",1,1) = '<' then" / " call define (_col_,'style','style=[BACKGROUND=#FFCC33 FONT_WEIGHT=BOLD]')" / ';' / 'url = "http://fabwtsdev.imec.be:8080/eDocStorageWebGui/Imec.eDoc.StorageWebGui.xbap"' / ' || "?CtxFormat=CtxName;CtxValue;Optional;EditMode&Ctx=";' / "T = substr(_" i z2. ",1,1) || '" i z2. "';" / 'url_SP = url || "LotId;" || compress(LOT_ID) || ";Man;NoEdit;Operation;"' / ' || compress(Operation) || ";Man;NoEdit;DuploWaferId;" || compress(T) || ";Opt;Edit";' / 'if _' i z2. " ne '-' and not notupper(substr(_" i z2. ",1,1)) then" / " CALL DEFINE(_COL_, 'URL', url_SP || ' target=""_blank""' )" / ';' / "endcomp;" ; end; run; I think that perhaps your issue is with the last CALL DEFINE statement. Do you need to separate the URL from the TARGET= option somehow? Perhaps by using quote(trim(url_SP))? You should test getting the syntax for this correct in a very simple example.
... View more