<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: macro with returned value string instead numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972445#M377505</link>
    <description>&lt;DIV&gt;/*&amp;nbsp; step 1 */&lt;/DIV&gt;
&lt;DIV&gt;data test ;&lt;/DIV&gt;
&lt;DIV&gt;delai = resolve(cats('%mc_delai_jours_ouvres_z21(' , '01JUL2025'd, ',' , '31JUL2025'd, ',FLG_JOU_OUV' , ',FR' , ',FR' , ')' )) ;&lt;/DIV&gt;
&lt;DIV&gt;run ;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/*&amp;nbsp; step 2 */&lt;/DIV&gt;
&lt;DIV&gt;proc sql;&lt;/DIV&gt;
&lt;DIV&gt;create table test2 as&lt;/DIV&gt;
&lt;DIV&gt;select case when resolve(cats('%mc_delai_jours_ouvres_z21(' , '01JUL2025'd, ',' , '31JUL2025'd, ',FLG_JOU_OUV' , ',FR' , ',FR' , ')' ))&amp;nbsp; &amp;gt; 6&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; then 'O'&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; else 'N' end as ANO_DELAI&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; from test ;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;quit ;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/*&amp;nbsp; below the log of the step 2*/&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;The SAS System Monday, August 11, 2025 10:58:00 AM&lt;/P&gt;
&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='MC_CALCUL_PERIODE.sas';&lt;BR /&gt;4 %LET _CLIENTPROCESSFLOWNAME='Standalone Not In Project';&lt;BR /&gt;5 %LET _CLIENTPROJECTPATH='';&lt;BR /&gt;6 %LET _CLIENTPROJECTPATHHOST='';&lt;BR /&gt;7 %LET _CLIENTPROJECTNAME='';&lt;BR /&gt;8 %LET _SASPROGRAMFILE='/home/ldap/mellouna/smsas/MC_CALCUL_PERIODE.sas';&lt;BR /&gt;9 %LET _SASPROGRAMFILEHOST='lsas1kj3.cm-cic.fr';&lt;BR /&gt;10 &lt;BR /&gt;11 ODS _ALL_ CLOSE;&lt;BR /&gt;12 OPTIONS DEV=SVG;&lt;BR /&gt;13 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14 %macro HTML5AccessibleGraphSupported;&lt;BR /&gt;15 %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) &amp;gt;= 0 %then ACCESSIBLE_GRAPH;&lt;BR /&gt;16 %mend;&lt;BR /&gt;17 FILENAME EGHTML TEMP;&lt;BR /&gt;18 ODS HTML5(ID=EGHTML) FILE=EGHTML&lt;BR /&gt;19 OPTIONS(BITMAP_MODE='INLINE')&lt;BR /&gt;20 %HTML5AccessibleGraphSupported&lt;BR /&gt;MPRINT(HTML5ACCESSIBLEGRAPHSUPPORTED): ACCESSIBLE_GRAPH&lt;BR /&gt;21 ENCODING='utf-8'&lt;BR /&gt;22 STYLE=HTMLBlue&lt;BR /&gt;23 NOGTITLE&lt;BR /&gt;24 NOGFOOTNOTE&lt;BR /&gt;25 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;26 ;&lt;BR /&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML&lt;BR /&gt;27 &lt;BR /&gt;28 %saseg_interactive_begin();&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): DATA _NULL_;&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): file &lt;BR /&gt;"/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_debut.log";&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): export_date=put(date(),ddmmyy10.);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): export_time=put(time(),time.);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): PUT "DEBUT;mellouna;'';'/home/ldap/mellouna/smsas/MC_CALCUL_PERIODE.sas';lsas1kj3;3217457;" &lt;BR /&gt;export_date+(-1)";" export_time+(-1);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): RUN;&lt;/P&gt;
&lt;P&gt;NOTE: The file "/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_debut.log" &lt;BR /&gt;is:&lt;BR /&gt;Filename=/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_debut.log,&lt;BR /&gt;Owner Name=mellouna,Group Name=domain users,&lt;BR /&gt;Access Permission=-rw-rw-r--,&lt;BR /&gt;Last Modified=11Aug2025:17:24:38&lt;/P&gt;
&lt;P&gt;NOTE: 1 record was written to the file &lt;BR /&gt;"/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_debut.log".&lt;BR /&gt;The minimum record length was 104.&lt;BR /&gt;The maximum record length was 104.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 605.03k&lt;BR /&gt;OS Memory 59324.00k&lt;BR /&gt;Timestamp 08/11/2025 05:24:38 PM&lt;BR /&gt;Step Count 186 Switch Count 0&lt;BR /&gt;2 The SAS System Monday, August 11, 2025 10:58:00 AM&lt;/P&gt;
&lt;P&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 22&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 0&lt;BR /&gt;Involuntary Context Switches 0&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 8&lt;/P&gt;
&lt;P&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): x "cat &lt;BR /&gt;/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_debut.log &amp;gt;&amp;gt; &lt;BR /&gt;$SAS_APPLI/data/stats/saseg_interactive.log";&lt;BR /&gt;29 &lt;BR /&gt;30 proc sql;&lt;BR /&gt;31 create table test2 as&lt;BR /&gt;32 select case when resolve(cats('%mc_delai_jours_ouvres_z21(' , '01JUL2025'd, ',' , '31JUL2025'd, ',FLG_JOU_OUV' , ',FR' ,&lt;BR /&gt;32 ! ',FR' , ')' )) &amp;gt; 6&lt;BR /&gt;33 then 'O'&lt;BR /&gt;34 else 'N' end as ANO_DELAI&lt;BR /&gt;35 from test ;&lt;BR /&gt;ERROR: Expression using greater than (&amp;gt;) has components that are of different data types.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;36 quit ;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 5755.53k&lt;BR /&gt;OS Memory 64448.00k&lt;BR /&gt;Timestamp 08/11/2025 05:24:38 PM&lt;BR /&gt;Step Count 187 Switch Count 0&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 10&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 0&lt;BR /&gt;Involuntary Context Switches 0&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 0&lt;BR /&gt;&lt;BR /&gt;37 &lt;BR /&gt;38 %saseg_interactive_end();&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): DATA _NULL_;&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): file &lt;BR /&gt;"/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_fin.log";&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): export_date=put(date(),ddmmyy10.);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): export_time=put(time(),time.);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): PUT "FIN;mellouna;'';'/home/ldap/mellouna/smsas/MC_CALCUL_PERIODE.sas';lsas1kj3;3217457;" &lt;BR /&gt;export_date+(-1)";" export_time+(-1);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): RUN;&lt;/P&gt;
&lt;P&gt;NOTE: The file "/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_fin.log" is:&lt;BR /&gt;Filename=/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_fin.log,&lt;BR /&gt;Owner Name=mellouna,Group Name=domain users,&lt;BR /&gt;Access Permission=-rw-rw-r--,&lt;BR /&gt;Last Modified=11Aug2025:17:24:38&lt;BR /&gt;3 The SAS System Monday, August 11, 2025 10:58:00 AM&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;NOTE: 1 record was written to the file &lt;BR /&gt;"/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_fin.log".&lt;BR /&gt;The minimum record length was 102.&lt;BR /&gt;The maximum record length was 102.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 717.15k&lt;BR /&gt;OS Memory 59324.00k&lt;BR /&gt;Timestamp 08/11/2025 05:24:38 PM&lt;BR /&gt;Step Count 188 Switch Count 0&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 22&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 0&lt;BR /&gt;Involuntary Context Switches 0&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 8&lt;/P&gt;
&lt;P&gt;MPRINT(SASEG_INTERACTIVE_END): x "cat &lt;BR /&gt;/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_fin.log &amp;gt;&amp;gt; &lt;BR /&gt;$SAS_APPLI/data/stats/saseg_interactive.log";&lt;BR /&gt;39 &lt;BR /&gt;40 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;41 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;42 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;43 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;44 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;45 %LET _SASPROGRAMFILE=;&lt;BR /&gt;46 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;47 &lt;BR /&gt;48 ;*';*";*/;quit;run;&lt;BR /&gt;49 ODS _ALL_ CLOSE;&lt;BR /&gt;50 &lt;BR /&gt;51 &lt;BR /&gt;52 QUIT; RUN;&lt;BR /&gt;53&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 11 Aug 2025 15:27:17 GMT</pubDate>
    <dc:creator>Nasser_DRMCP</dc:creator>
    <dc:date>2025-08-11T15:27:17Z</dc:date>
    <item>
      <title>macro with returned value string instead numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972441#M377502</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

%macro mc_delai_jours_ouvres_Z21
	(
		  p_date_debut
		, p_date_fin
		, p_flag_jour_ouvre
		, p_cod_pay_iso
		, p_cod_lng
	) ;

	%local	rc nbr_jou_ouv ;

	%let p_date_min = min(&amp;amp;p_date_debut,&amp;amp;p_date_fin) ;
	%let p_date_max = max(&amp;amp;p_date_debut,&amp;amp;p_date_fin) ;

	%if &amp;amp;p_date_debut &amp;lt;= &amp;amp;p_date_fin %then
		%do ;
			%let sens_chrono = 1 ; 
		%end ;
		%else %do ;
			%let sens_chrono = -1 ; 
		%end ;
	

	%let rc=%sysfunc(dosubl(%nrstr(
		proc sql noprint ;
		  select count(DAT_CVL) * &amp;amp;sens_chrono into :nbr_jou_ouv
		  from SBOX.&amp;amp;mv_prefixe_tab_dim._Z21I_5ans  
		  where DAT_CVL &amp;gt; &amp;amp;p_date_min
		  	and DAT_CVL &amp;lt;= &amp;amp;p_date_max
			and &amp;amp;p_flag_jour_ouvre = 'O'
			and COD_PAY_ISO = "&amp;amp;p_cod_pay_iso"
			and COD_LNG_RIU = "&amp;amp;p_cod_lng"
		;
		quit;
	))) ;

	%superq(nbr_jou_ouv)

%mend mc_delai_jours_ouvres_z21 ;

data test ;
delai = resolve(cats('%mc_delai_jours_ouvres_z21(' , '01JUL2025'd, ',' , '31JUL2025'd, ',FLG_JOU_OUV' , ',FR' , ',FR' , ')' )) ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;hello&lt;/P&gt;
&lt;P&gt;this is the code of my macro that calculate a delay between two dates. and&amp;nbsp;the result is correct. i mean, the "delai" column in the test table is 21.&lt;/P&gt;
&lt;P&gt;but this returned delai is a string and not a numeric . so by using this kind of comparator if delai &amp;gt; 6 ...i get this&lt;/P&gt;
&lt;P&gt;"ERROR: Expression using greater than (&amp;gt;) has components that are of different data types."&lt;/P&gt;</description>
      <pubDate>Mon, 11 Aug 2025 15:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972441#M377502</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2025-08-11T15:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: macro with returned value string instead numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972442#M377503</link>
      <description>&lt;P&gt;I get a different error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please show us all of the log for this program ... not just the error messages.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Aug 2025 15:19:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972442#M377503</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-08-11T15:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: macro with returned value string instead numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972445#M377505</link>
      <description>&lt;DIV&gt;/*&amp;nbsp; step 1 */&lt;/DIV&gt;
&lt;DIV&gt;data test ;&lt;/DIV&gt;
&lt;DIV&gt;delai = resolve(cats('%mc_delai_jours_ouvres_z21(' , '01JUL2025'd, ',' , '31JUL2025'd, ',FLG_JOU_OUV' , ',FR' , ',FR' , ')' )) ;&lt;/DIV&gt;
&lt;DIV&gt;run ;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/*&amp;nbsp; step 2 */&lt;/DIV&gt;
&lt;DIV&gt;proc sql;&lt;/DIV&gt;
&lt;DIV&gt;create table test2 as&lt;/DIV&gt;
&lt;DIV&gt;select case when resolve(cats('%mc_delai_jours_ouvres_z21(' , '01JUL2025'd, ',' , '31JUL2025'd, ',FLG_JOU_OUV' , ',FR' , ',FR' , ')' ))&amp;nbsp; &amp;gt; 6&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; then 'O'&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; else 'N' end as ANO_DELAI&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; from test ;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;quit ;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/*&amp;nbsp; below the log of the step 2*/&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;The SAS System Monday, August 11, 2025 10:58:00 AM&lt;/P&gt;
&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='MC_CALCUL_PERIODE.sas';&lt;BR /&gt;4 %LET _CLIENTPROCESSFLOWNAME='Standalone Not In Project';&lt;BR /&gt;5 %LET _CLIENTPROJECTPATH='';&lt;BR /&gt;6 %LET _CLIENTPROJECTPATHHOST='';&lt;BR /&gt;7 %LET _CLIENTPROJECTNAME='';&lt;BR /&gt;8 %LET _SASPROGRAMFILE='/home/ldap/mellouna/smsas/MC_CALCUL_PERIODE.sas';&lt;BR /&gt;9 %LET _SASPROGRAMFILEHOST='lsas1kj3.cm-cic.fr';&lt;BR /&gt;10 &lt;BR /&gt;11 ODS _ALL_ CLOSE;&lt;BR /&gt;12 OPTIONS DEV=SVG;&lt;BR /&gt;13 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14 %macro HTML5AccessibleGraphSupported;&lt;BR /&gt;15 %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) &amp;gt;= 0 %then ACCESSIBLE_GRAPH;&lt;BR /&gt;16 %mend;&lt;BR /&gt;17 FILENAME EGHTML TEMP;&lt;BR /&gt;18 ODS HTML5(ID=EGHTML) FILE=EGHTML&lt;BR /&gt;19 OPTIONS(BITMAP_MODE='INLINE')&lt;BR /&gt;20 %HTML5AccessibleGraphSupported&lt;BR /&gt;MPRINT(HTML5ACCESSIBLEGRAPHSUPPORTED): ACCESSIBLE_GRAPH&lt;BR /&gt;21 ENCODING='utf-8'&lt;BR /&gt;22 STYLE=HTMLBlue&lt;BR /&gt;23 NOGTITLE&lt;BR /&gt;24 NOGFOOTNOTE&lt;BR /&gt;25 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;26 ;&lt;BR /&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML&lt;BR /&gt;27 &lt;BR /&gt;28 %saseg_interactive_begin();&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): DATA _NULL_;&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): file &lt;BR /&gt;"/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_debut.log";&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): export_date=put(date(),ddmmyy10.);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): export_time=put(time(),time.);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): PUT "DEBUT;mellouna;'';'/home/ldap/mellouna/smsas/MC_CALCUL_PERIODE.sas';lsas1kj3;3217457;" &lt;BR /&gt;export_date+(-1)";" export_time+(-1);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): RUN;&lt;/P&gt;
&lt;P&gt;NOTE: The file "/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_debut.log" &lt;BR /&gt;is:&lt;BR /&gt;Filename=/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_debut.log,&lt;BR /&gt;Owner Name=mellouna,Group Name=domain users,&lt;BR /&gt;Access Permission=-rw-rw-r--,&lt;BR /&gt;Last Modified=11Aug2025:17:24:38&lt;/P&gt;
&lt;P&gt;NOTE: 1 record was written to the file &lt;BR /&gt;"/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_debut.log".&lt;BR /&gt;The minimum record length was 104.&lt;BR /&gt;The maximum record length was 104.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 605.03k&lt;BR /&gt;OS Memory 59324.00k&lt;BR /&gt;Timestamp 08/11/2025 05:24:38 PM&lt;BR /&gt;Step Count 186 Switch Count 0&lt;BR /&gt;2 The SAS System Monday, August 11, 2025 10:58:00 AM&lt;/P&gt;
&lt;P&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 22&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 0&lt;BR /&gt;Involuntary Context Switches 0&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 8&lt;/P&gt;
&lt;P&gt;MPRINT(SASEG_INTERACTIVE_BEGIN): x "cat &lt;BR /&gt;/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_debut.log &amp;gt;&amp;gt; &lt;BR /&gt;$SAS_APPLI/data/stats/saseg_interactive.log";&lt;BR /&gt;29 &lt;BR /&gt;30 proc sql;&lt;BR /&gt;31 create table test2 as&lt;BR /&gt;32 select case when resolve(cats('%mc_delai_jours_ouvres_z21(' , '01JUL2025'd, ',' , '31JUL2025'd, ',FLG_JOU_OUV' , ',FR' ,&lt;BR /&gt;32 ! ',FR' , ')' )) &amp;gt; 6&lt;BR /&gt;33 then 'O'&lt;BR /&gt;34 else 'N' end as ANO_DELAI&lt;BR /&gt;35 from test ;&lt;BR /&gt;ERROR: Expression using greater than (&amp;gt;) has components that are of different data types.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;36 quit ;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 5755.53k&lt;BR /&gt;OS Memory 64448.00k&lt;BR /&gt;Timestamp 08/11/2025 05:24:38 PM&lt;BR /&gt;Step Count 187 Switch Count 0&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 10&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 0&lt;BR /&gt;Involuntary Context Switches 0&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 0&lt;BR /&gt;&lt;BR /&gt;37 &lt;BR /&gt;38 %saseg_interactive_end();&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): DATA _NULL_;&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): file &lt;BR /&gt;"/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_fin.log";&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): export_date=put(date(),ddmmyy10.);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): export_time=put(time(),time.);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): PUT "FIN;mellouna;'';'/home/ldap/mellouna/smsas/MC_CALCUL_PERIODE.sas';lsas1kj3;3217457;" &lt;BR /&gt;export_date+(-1)";" export_time+(-1);&lt;BR /&gt;MPRINT(SASEG_INTERACTIVE_END): RUN;&lt;/P&gt;
&lt;P&gt;NOTE: The file "/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_fin.log" is:&lt;BR /&gt;Filename=/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_fin.log,&lt;BR /&gt;Owner Name=mellouna,Group Name=domain users,&lt;BR /&gt;Access Permission=-rw-rw-r--,&lt;BR /&gt;Last Modified=11Aug2025:17:24:38&lt;BR /&gt;3 The SAS System Monday, August 11, 2025 10:58:00 AM&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;NOTE: 1 record was written to the file &lt;BR /&gt;"/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_fin.log".&lt;BR /&gt;The minimum record length was 102.&lt;BR /&gt;The maximum record length was 102.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 717.15k&lt;BR /&gt;OS Memory 59324.00k&lt;BR /&gt;Timestamp 08/11/2025 05:24:38 PM&lt;BR /&gt;Step Count 188 Switch Count 0&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 22&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 0&lt;BR /&gt;Involuntary Context Switches 0&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 8&lt;/P&gt;
&lt;P&gt;MPRINT(SASEG_INTERACTIVE_END): x "cat &lt;BR /&gt;/data/sastmp1/saswork/SAS_work7A1400311831_lsas1kj3/SAS_work9D0400311831_lsas1kj3/saseg_interactive_tmp_fin.log &amp;gt;&amp;gt; &lt;BR /&gt;$SAS_APPLI/data/stats/saseg_interactive.log";&lt;BR /&gt;39 &lt;BR /&gt;40 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;41 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;42 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;43 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;44 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;45 %LET _SASPROGRAMFILE=;&lt;BR /&gt;46 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;47 &lt;BR /&gt;48 ;*';*";*/;quit;run;&lt;BR /&gt;49 ODS _ALL_ CLOSE;&lt;BR /&gt;50 &lt;BR /&gt;51 &lt;BR /&gt;52 QUIT; RUN;&lt;BR /&gt;53&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Aug 2025 15:27:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972445#M377505</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2025-08-11T15:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: macro with returned value string instead numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972449#M377507</link>
      <description>&lt;P&gt;You appear to be trying to compare the value returned by the character function RESOLVE() to the numeric constant 6.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table test2 as
select case 
   when resolve(...) &amp;gt; 6 
   then 'O'
   else 'N' 
   end as ANO_DELAI
from test 
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to convert a string into a number use the INPUT function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;when input(resolve(.....),32.) &amp;gt; 6 ..&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Aug 2025 16:09:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972449#M377507</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-08-11T16:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: macro with returned value string instead numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972450#M377508</link>
      <description>&lt;P&gt;You could use the INPUT function to convert the value returned by RESOLVE to numeric, like below example using sashelp.class:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro try(name=) ;
  %local age ;
  %let rc=%sysfunc(dosubl(%nrstr(
 		proc sql noprint ;
		  select age into :age
      from sashelp.class 
		  where name="&amp;amp;name"
		;
		quit;
	))) ;

  &amp;amp;age
%mend ;

proc sql ;
  create table test2 as 
  select age
        ,case when input(resolve(cats('%try(name=' , name, ')' )),32.)  &amp;gt; 12 then 'A' else 'B' end as foo
  from sashelp.class 
   ;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But this will run very slowly, because DOSUBL is slow (it does a lot of work), and you are calling DOSUBL for every record in in your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't quite follow the logic of your code, but it would probably be possible to rewrite this as a pure SQL query, and avoid use of DOSUBL.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Aug 2025 16:15:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-with-returned-value-string-instead-numeric/m-p/972450#M377508</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-08-11T16:15:55Z</dc:date>
    </item>
  </channel>
</rss>

