The code does what I want him to do, but it seems so overcomplicated what I do...
The final macro variable resolves to
O:\Arne\OUTINSIGHTS\heat_ALL_retail_2017_2018_AB_CD.htm
That's correct, but there has to be an easier way to achieve this.
Bye, Arne
OPTIONS MLOGIC SYMBOLGEN;
%LET BRA = "ALL";
%LET PRO1= "AB";
%LET PRO2="CD";
%LET YE1=2017;
%LET YE2=2018;
%LET H1=%SYSFUNC(CATX("_",&PRO1, &PRO2));
%let H2=%sysfunc(translate(%superq(H1),%str( ),%str(%")));
%PUT &H2;
%LET NA= %SYSFUNC(CATX("",O:\Arne\OUTINSIGHTS\heat_,%SYSFUNC(DEQUOTE(&BRA.)),_retail_,&YE1,_,&YE2,_, &H2.,.htm));
%let NA1=%sysfunc(translate(%superq(NA),%str( ),%str(%")));
%LET NA2=%sysfunc(COMPRESS(&NA1));
FILENAME HT_APP "&NA2";
ODS GRAPHICS ON/ IMAGEMAP=ON IMAGENAME=&BRA. width=7in height=5in;
ODS HTML FILE=HT_APP NOGTITLE GPATH='O:\Arne\OUTINSIGHTS\' (url='');
title "%SYSFUNC(DEQUOTE(&BRA.)) Retail &YE1. &YE2. %SYSFUNC(DEQUOTE(&PRO1.)) %SYSFUNC(DEQUOTE(&PRO2.)) : ";
@acordes wrote:
The code does what I want him to do, but it seems so overcomplicated what I do...
The final macro variable resolves to
O:\Arne\OUTINSIGHTS\heat_ALL_retail_2017_2018_AB_CD.htm
That's correct, but there has to be an easier way to achieve this.
%LET BRA = "ALL"; %LET PRO1= "AB"; %LET PRO2="CD";
Macro variable values are almost never surrounded by quotes. Then you don't need to de-quote them later.
So, after you remove those annoying quotes, to get &NA2
%let na2 = O:\Arne\OUTINSIGHTS\Heat_&bra._retail_&ye1._&ye2._&pro1._&pro2..htm;
@acordes wrote:
The code does what I want him to do, but it seems so overcomplicated what I do...
The final macro variable resolves to
O:\Arne\OUTINSIGHTS\heat_ALL_retail_2017_2018_AB_CD.htm
That's correct, but there has to be an easier way to achieve this.
%LET BRA = "ALL"; %LET PRO1= "AB"; %LET PRO2="CD";
Macro variable values are almost never surrounded by quotes. Then you don't need to de-quote them later.
So, after you remove those annoying quotes, to get &NA2
%let na2 = O:\Arne\OUTINSIGHTS\Heat_&bra._retail_&ye1._&ye2._&pro1._&pro2..htm;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.