<?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: Need help in PC SAS code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/959038#M374245</link>
    <description>&lt;P&gt;I suspect you are having trouble defining your macro variables which is leading to the invalid code generation by your macros.&amp;nbsp; But it is extremely hard to follow your SAS log because of the following things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mainly because you pasted into the body of you message so it got reflowed as paragraphs and printed with proportional font.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also you seem to have placed one macro definition inside of another.&amp;nbsp; That is just going to confuse the humans that have to try and understand the code.&amp;nbsp; Unlike macro variables that can live in local symbol tables the address space for macros is flat.&amp;nbsp; So define each macro independently.&amp;nbsp; This will make the code easier to follow and make it clearer which macro variable should be local to which macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally your use of DOSUBL to try and run "side" sessions of SAS code.&amp;nbsp; You could make your flow simpler by just having the data step write the macro calls to a text file and then use %INCLUDE to run the generated code after the data step has finished.&amp;nbsp; That will make the process flow be more linear and easier to debug.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2025 14:25:46 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-02-12T14:25:46Z</dc:date>
    <item>
      <title>Need help in PC SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/959011#M374238</link>
      <description>&lt;P&gt;I am trying to collect the status of meta server by proc metaoperate to each server( server is to be fetched using macro).&lt;/P&gt;&lt;P&gt;The attached code seems to run without even running proc metaoperate part. Could you please help me in resolving the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;298 libname final "C:\Users\ghospiya\OneDrive - Merck Sharp &amp;amp; Dohme LLC\Documents\Status_jobs";&lt;BR /&gt;NOTE: Libref FINAL was successfully assigned as follows:&lt;BR /&gt;Engine: V9&lt;BR /&gt;Physical Name: C:\Users\ghospiya\OneDrive - Merck Sharp &amp;amp; Dohme LLC\Documents\Status_jobs&lt;BR /&gt;299 DATA WORK.TEST;&lt;BR /&gt;300 LENGTH&lt;BR /&gt;301 Server $ 11 ;&lt;BR /&gt;302 FORMAT&lt;BR /&gt;303 Server $CHAR11. ;&lt;BR /&gt;304 INFORMAT&lt;BR /&gt;305 Server $CHAR11. ;&lt;BR /&gt;306 INFILE 'C:\Users\ghospiya\OneDrive - Merck Sharp &amp;amp; Dohme&lt;BR /&gt;306! LLC\Documents\Status_jobs\test1.txt'&lt;BR /&gt;307 LRECL=32767&lt;BR /&gt;308 ENCODING="WLATIN1"&lt;BR /&gt;309 DLM='2c'x&lt;BR /&gt;310 MISSOVER&lt;BR /&gt;311 DSD ;&lt;BR /&gt;312 INPUT&lt;BR /&gt;313 Server : $CHAR11. ;&lt;BR /&gt;314 RUN;&lt;/P&gt;&lt;P&gt;NOTE: The infile 'C:\Users\ghospiya\OneDrive - Merck Sharp &amp;amp; Dohme&lt;BR /&gt;LLC\Documents\Status_jobs\test1.txt' is:&lt;BR /&gt;Filename=C:\Users\ghospiya\OneDrive - Merck Sharp &amp;amp; Dohme LLC\Documents\Status_jobs\test1.txt,&lt;BR /&gt;RECFM=V,LRECL=32767,File Size (bytes)=36,&lt;BR /&gt;Last Modified=22Jan2025:13:27:47,&lt;BR /&gt;Create Time=13Jan2025:13:01:26&lt;/P&gt;&lt;P&gt;NOTE: 3 records were read from the infile 'C:\Users\ghospiya\OneDrive - Merck Sharp &amp;amp; Dohme&lt;BR /&gt;LLC\Documents\Status_jobs\test1.txt'.&lt;BR /&gt;The minimum record length was 10.&lt;BR /&gt;The maximum record length was 10.&lt;BR /&gt;NOTE: The data set WORK.TEST has 3 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;315 OPTIONS MPRINT MLOGIC SYMBOLGEN;&lt;BR /&gt;316&lt;BR /&gt;317&lt;BR /&gt;318 %macro Do_stuff(input_var);&lt;BR /&gt;319 %let srv1 = %str(%'&amp;amp;input_var.%');&lt;BR /&gt;320 %macro meta_server ( serv,srv );&lt;BR /&gt;321 %put &amp;amp;serv;&lt;BR /&gt;322 %put &amp;amp;srv;&lt;BR /&gt;323 PROC METAOPERATE&lt;BR /&gt;324 SERVER=&amp;amp;srv&lt;BR /&gt;325 PORT=8561&lt;BR /&gt;326 USERID='sasadm@saspw'&lt;BR /&gt;327 PASSWORD='xxxx'&lt;BR /&gt;328 PROTOCOL=BRIDGE&lt;BR /&gt;329 ACTION=STATUS&lt;BR /&gt;330 out=metaout;&lt;BR /&gt;331 RUN;&lt;BR /&gt;332&lt;BR /&gt;333 /*%macro check_exists(data);&lt;BR /&gt;334 %if %sysfunc(exist(&amp;amp;data.)) %then %do;&lt;BR /&gt;335 %put Dataset Exists;*/&lt;BR /&gt;336&lt;BR /&gt;337 data work.metaout_t;&lt;BR /&gt;338 set work.metaout;&lt;BR /&gt;339 keep attribute value;&lt;BR /&gt;340 where attribute in ('Server','Query Time','Status');&lt;BR /&gt;341 run;&lt;BR /&gt;342&lt;BR /&gt;343 proc sql;&lt;BR /&gt;344 select value into :a from metaout_t where attribute='Server' ;&lt;BR /&gt;345 quit;&lt;BR /&gt;346&lt;BR /&gt;347 proc transpose data=work.metaout_t out=metastat_&amp;amp;a(rename=(col1=server col2=date col3=status)&lt;BR /&gt;347! drop=_name_);&lt;BR /&gt;348 var value;&lt;BR /&gt;349 run;&lt;BR /&gt;350&lt;BR /&gt;351 /* %end;&lt;BR /&gt;352 %else %do;&lt;BR /&gt;353 %put Dataset Does Not Exist;&lt;BR /&gt;354 data metaout_t_&amp;amp;serv;&lt;BR /&gt;355 server=symget('serv');&lt;BR /&gt;356 date= "&amp;amp;sysdate"d;&lt;BR /&gt;357 format run_date date9.;&lt;BR /&gt;358 status= 'Not Running';&lt;BR /&gt;359 run;&lt;BR /&gt;360 %end;&lt;BR /&gt;361 %mend check_exists;&lt;BR /&gt;362 %check_exists(metaout); */&lt;BR /&gt;363&lt;BR /&gt;364 proc append data=metastat_&amp;amp;serv base=final.metastat_out force;run;&lt;BR /&gt;365&lt;BR /&gt;366 %mend meta_server;&lt;BR /&gt;367 %meta_server ( &amp;amp;input_var, &amp;amp;srv1 );&lt;BR /&gt;368 %mend do_stuff;&lt;BR /&gt;369&lt;BR /&gt;370 data _null_;&lt;BR /&gt;371 set WORK.TEST;&lt;BR /&gt;372 rc=dosubl('%do_stuff('||Server||')' );&lt;BR /&gt;373 run;&lt;/P&gt;&lt;P&gt;MLOGIC(DO_STUFF): Beginning execution.&lt;BR /&gt;MLOGIC(DO_STUFF): Parameter INPUT_VAR has value lctcvt7962&lt;BR /&gt;MLOGIC(DO_STUFF): %LET (variable name is SRV1)&lt;BR /&gt;SYMBOLGEN: Macro variable INPUT_VAR resolves to lctcvt7962&lt;BR /&gt;MLOGIC(META_SERVER): Beginning execution.&lt;BR /&gt;SYMBOLGEN: Macro variable INPUT_VAR resolves to lctcvt7962&lt;BR /&gt;SYMBOLGEN: Macro variable SRV1 resolves to 'lctcvt7962'&lt;BR /&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;unquoted for printing.&lt;BR /&gt;MLOGIC(META_SERVER): Parameter SERV has value lctcvt7962&lt;BR /&gt;MLOGIC(META_SERVER): Parameter SRV has value &amp;#1;&amp;#17;lctcvt7962&amp;#17;&amp;#2;&lt;BR /&gt;MLOGIC(META_SERVER): %PUT &amp;amp;serv&lt;BR /&gt;SYMBOLGEN: Macro variable SERV resolves to lctcvt7962&lt;BR /&gt;lctcvt7962&lt;BR /&gt;MLOGIC(META_SERVER): %PUT &amp;amp;srv&lt;BR /&gt;SYMBOLGEN: Macro variable SRV resolves to 'lctcvt7962'&lt;BR /&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;unquoted for printing.&lt;BR /&gt;'lctcvt7962'&lt;BR /&gt;ERROR 22-322: Expecting a quoted string.&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;SYMBOLGEN: Macro variable SRV resolves to 'lctcvt7962'&lt;BR /&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;unquoted for printing.&lt;BR /&gt;MPRINT(META_SERVER): PROC METAOPERATE SERVER='lctcvt7962' PORT=8561 USERID='sasadm@saspw'&lt;BR /&gt;PASSWORD='xxxx' PROTOCOL=BRIDGE ACTION=STATUS out=metaout;&lt;BR /&gt;MPRINT(META_SERVER): RUN;&lt;BR /&gt;WARNING: RUN statement ignored due to previous errors. Submit QUIT; to terminate the procedure.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.METAOUT may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 0 variables.&lt;BR /&gt;WARNING: Data set WORK.METAOUT was not replaced because this step was stopped.&lt;BR /&gt;NOTE: PROCEDURE METAOPERATE used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MPRINT(META_SERVER): data work.metaout_t;&lt;BR /&gt;MPRINT(META_SERVER): set work.metaout;&lt;BR /&gt;MPRINT(META_SERVER): keep attribute value;&lt;BR /&gt;MPRINT(META_SERVER): where attribute in ('Server','Query Time','Status');&lt;BR /&gt;ERROR: Variable attribute is not on file WORK.METAOUT.&lt;BR /&gt;MPRINT(META_SERVER): run;&lt;BR /&gt;WARNING: The variable attribute in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;WARNING: The variable value in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.METAOUT_T may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 0 variables.&lt;BR /&gt;WARNING: Data set WORK.METAOUT_T was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MPRINT(META_SERVER): proc sql;&lt;BR /&gt;MPRINT(META_SERVER): select value into :a from metaout_t where attribute='Server' ;&lt;BR /&gt;ERROR: Table WORK.METAOUT_T doesn't have any columns. PROC SQL requires each of its tables to have&lt;BR /&gt;at least 1 column.&lt;BR /&gt;ERROR: The following columns were not found in the contributing tables: attribute, value.&lt;BR /&gt;MPRINT(META_SERVER): 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;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATA, DELIM, DELIMITER, INDB,&lt;BR /&gt;LABEL, LET, NAME, OUT, PREFIX, SUFFIX.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;WARNING: Apparent symbolic reference A not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference A not resolved.&lt;BR /&gt;MPRINT(META_SERVER): proc transpose data=work.metaout_t out=metastat_&amp;amp;a(rename=(col1=server&lt;BR /&gt;col2=date col3=status) drop=_name_);&lt;BR /&gt;MPRINT(META_SERVER): var value;&lt;BR /&gt;MPRINT(META_SERVER): run;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE TRANSPOSE used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SYMBOLGEN: Macro variable SERV resolves to lctcvt7962&lt;BR /&gt;ERROR: File WORK.METASTAT_LCTCVT7962.DATA does not exist.&lt;BR /&gt;MPRINT(META_SERVER): proc append data=metastat_lctcvt7962 base=final.metastat_out force;&lt;BR /&gt;MPRINT(META_SERVER): run;&lt;BR /&gt;NOTE: Statements not processed because of errors noted above.&lt;BR /&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;MLOGIC(META_SERVER): Ending execution.&lt;BR /&gt;MPRINT(DO_STUFF): ;&lt;BR /&gt;MLOGIC(DO_STUFF): Ending execution.&lt;/P&gt;&lt;P&gt;MLOGIC(DO_STUFF): Beginning execution.&lt;BR /&gt;MLOGIC(DO_STUFF): Parameter INPUT_VAR has value lctcvt7982&lt;BR /&gt;MLOGIC(DO_STUFF): %LET (variable name is SRV1)&lt;BR /&gt;SYMBOLGEN: Macro variable INPUT_VAR resolves to lctcvt7982&lt;BR /&gt;MLOGIC(META_SERVER): Beginning execution.&lt;BR /&gt;SYMBOLGEN: Macro variable INPUT_VAR resolves to lctcvt7982&lt;BR /&gt;SYMBOLGEN: Macro variable SRV1 resolves to 'lctcvt7982'&lt;BR /&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;unquoted for printing.&lt;BR /&gt;MLOGIC(META_SERVER): Parameter SERV has value lctcvt7982&lt;BR /&gt;MLOGIC(META_SERVER): Parameter SRV has value &amp;#1;&amp;#17;lctcvt7982&amp;#17;&amp;#2;&lt;BR /&gt;MLOGIC(META_SERVER): %PUT &amp;amp;serv&lt;BR /&gt;SYMBOLGEN: Macro variable SERV resolves to lctcvt7982&lt;BR /&gt;lctcvt7982&lt;BR /&gt;MLOGIC(META_SERVER): %PUT &amp;amp;srv&lt;BR /&gt;SYMBOLGEN: Macro variable SRV resolves to 'lctcvt7982'&lt;BR /&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;unquoted for printing.&lt;BR /&gt;'lctcvt7982'&lt;BR /&gt;ERROR 22-322: Expecting a quoted string.&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;SYMBOLGEN: Macro variable SRV resolves to 'lctcvt7982'&lt;BR /&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;unquoted for printing.&lt;BR /&gt;MPRINT(META_SERVER): PROC METAOPERATE SERVER='lctcvt7982' PORT=8561 USERID='sasadm@saspw'&lt;BR /&gt;PASSWORD='xxxx' PROTOCOL=BRIDGE ACTION=STATUS out=metaout;&lt;BR /&gt;MPRINT(META_SERVER): RUN;&lt;BR /&gt;WARNING: RUN statement ignored due to previous errors. Submit QUIT; to terminate the procedure.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.METAOUT may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 0 variables.&lt;BR /&gt;WARNING: Data set WORK.METAOUT was not replaced because this step was stopped.&lt;BR /&gt;NOTE: PROCEDURE METAOPERATE used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MPRINT(META_SERVER): data work.metaout_t;&lt;BR /&gt;MPRINT(META_SERVER): set work.metaout;&lt;BR /&gt;MPRINT(META_SERVER): keep attribute value;&lt;BR /&gt;MPRINT(META_SERVER): where attribute in ('Server','Query Time','Status');&lt;BR /&gt;ERROR: Variable attribute is not on file WORK.METAOUT.&lt;BR /&gt;MPRINT(META_SERVER): run;&lt;BR /&gt;WARNING: The variable attribute in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;WARNING: The variable value in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.METAOUT_T may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 0 variables.&lt;BR /&gt;WARNING: Data set WORK.METAOUT_T was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MPRINT(META_SERVER): proc sql;&lt;BR /&gt;MPRINT(META_SERVER): select value into :a from metaout_t where attribute='Server' ;&lt;BR /&gt;ERROR: Table WORK.METAOUT_T doesn't have any columns. PROC SQL requires each of its tables to have&lt;BR /&gt;at least 1 column.&lt;BR /&gt;ERROR: The following columns were not found in the contributing tables: attribute, value.&lt;BR /&gt;MPRINT(META_SERVER): 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.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATA, DELIM, DELIMITER, INDB,&lt;BR /&gt;LABEL, LET, NAME, OUT, PREFIX, SUFFIX.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;WARNING: Apparent symbolic reference A not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference A not resolved.&lt;BR /&gt;MPRINT(META_SERVER): proc transpose data=work.metaout_t out=metastat_&amp;amp;a(rename=(col1=server&lt;BR /&gt;col2=date col3=status) drop=_name_);&lt;BR /&gt;MPRINT(META_SERVER): var value;&lt;BR /&gt;MPRINT(META_SERVER): run;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE TRANSPOSE used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SYMBOLGEN: Macro variable SERV resolves to lctcvt7982&lt;BR /&gt;ERROR: File WORK.METASTAT_LCTCVT7982.DATA does not exist.&lt;BR /&gt;MPRINT(META_SERVER): proc append data=metastat_lctcvt7982 base=final.metastat_out force;&lt;BR /&gt;MPRINT(META_SERVER): run;&lt;BR /&gt;NOTE: Statements not processed because of errors noted above.&lt;BR /&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;MLOGIC(META_SERVER): Ending execution.&lt;BR /&gt;MPRINT(DO_STUFF): ;&lt;BR /&gt;MLOGIC(DO_STUFF): Ending execution.&lt;/P&gt;&lt;P&gt;MLOGIC(DO_STUFF): Beginning execution.&lt;BR /&gt;MLOGIC(DO_STUFF): Parameter INPUT_VAR has value lctcvt7983&lt;BR /&gt;MLOGIC(DO_STUFF): %LET (variable name is SRV1)&lt;BR /&gt;SYMBOLGEN: Macro variable INPUT_VAR resolves to lctcvt7983&lt;BR /&gt;MLOGIC(META_SERVER): Beginning execution.&lt;BR /&gt;SYMBOLGEN: Macro variable INPUT_VAR resolves to lctcvt7983&lt;BR /&gt;SYMBOLGEN: Macro variable SRV1 resolves to 'lctcvt7983'&lt;BR /&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;unquoted for printing.&lt;BR /&gt;MLOGIC(META_SERVER): Parameter SERV has value lctcvt7983&lt;BR /&gt;MLOGIC(META_SERVER): Parameter SRV has value &amp;#1;&amp;#17;lctcvt7983&amp;#17;&amp;#2;&lt;BR /&gt;MLOGIC(META_SERVER): %PUT &amp;amp;serv&lt;BR /&gt;SYMBOLGEN: Macro variable SERV resolves to lctcvt7983&lt;BR /&gt;lctcvt7983&lt;BR /&gt;MLOGIC(META_SERVER): %PUT &amp;amp;srv&lt;BR /&gt;SYMBOLGEN: Macro variable SRV resolves to 'lctcvt7983'&lt;BR /&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;unquoted for printing.&lt;BR /&gt;'lctcvt7983'&lt;BR /&gt;ERROR 22-322: Expecting a quoted string.&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;SYMBOLGEN: Macro variable SRV resolves to 'lctcvt7983'&lt;BR /&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;unquoted for printing.&lt;BR /&gt;MPRINT(META_SERVER): PROC METAOPERATE SERVER='lctcvt7983' PORT=8561 USERID='sasadm@saspw'&lt;BR /&gt;PASSWORD='xxxx' PROTOCOL=BRIDGE ACTION=STATUS out=metaout;&lt;BR /&gt;MPRINT(META_SERVER): RUN;&lt;BR /&gt;WARNING: RUN statement ignored due to previous errors. Submit QUIT; to terminate the procedure.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.METAOUT may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 0 variables.&lt;BR /&gt;WARNING: Data set WORK.METAOUT was not replaced because this step was stopped.&lt;BR /&gt;NOTE: PROCEDURE METAOPERATE used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MPRINT(META_SERVER): data work.metaout_t;&lt;BR /&gt;MPRINT(META_SERVER): set work.metaout;&lt;BR /&gt;MPRINT(META_SERVER): keep attribute value;&lt;BR /&gt;MPRINT(META_SERVER): where attribute in ('Server','Query Time','Status');&lt;BR /&gt;ERROR: Variable attribute is not on file WORK.METAOUT.&lt;BR /&gt;MPRINT(META_SERVER): run;&lt;BR /&gt;WARNING: The variable attribute in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;WARNING: The variable value in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.METAOUT_T may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 0 variables.&lt;BR /&gt;WARNING: Data set WORK.METAOUT_T was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MPRINT(META_SERVER): proc sql;&lt;BR /&gt;MPRINT(META_SERVER): select value into :a from metaout_t where attribute='Server' ;&lt;BR /&gt;ERROR: Table WORK.METAOUT_T doesn't have any columns. PROC SQL requires each of its tables to have&lt;BR /&gt;at least 1 column.&lt;BR /&gt;ERROR: The following columns were not found in the contributing tables: attribute, value.&lt;BR /&gt;MPRINT(META_SERVER): 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.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATA, DELIM, DELIMITER, INDB,&lt;BR /&gt;LABEL, LET, NAME, OUT, PREFIX, SUFFIX.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;WARNING: Apparent symbolic reference A not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference A not resolved.&lt;BR /&gt;MPRINT(META_SERVER): proc transpose data=work.metaout_t out=metastat_&amp;amp;a(rename=(col1=server&lt;BR /&gt;col2=date col3=status) drop=_name_);&lt;BR /&gt;MPRINT(META_SERVER): var value;&lt;BR /&gt;MPRINT(META_SERVER): run;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE TRANSPOSE used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SYMBOLGEN: Macro variable SERV resolves to lctcvt7983&lt;BR /&gt;ERROR: File WORK.METASTAT_LCTCVT7983.DATA does not exist.&lt;BR /&gt;MPRINT(META_SERVER): proc append data=metastat_lctcvt7983 base=final.metastat_out force;&lt;BR /&gt;MPRINT(META_SERVER): run;&lt;BR /&gt;NOTE: Statements not processed because of errors noted above.&lt;BR /&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;MLOGIC(META_SERVER): Ending execution.&lt;BR /&gt;MPRINT(DO_STUFF): ;&lt;BR /&gt;MLOGIC(DO_STUFF): Ending execution.&lt;/P&gt;&lt;P&gt;NOTE: There were 3 observations read from the data set WORK.TEST.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 1.11 seconds&lt;BR /&gt;cpu time 0.57 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;374&lt;BR /&gt;375 options mprint;&lt;BR /&gt;376&lt;BR /&gt;377 data x ;set final.metastat_out;&lt;BR /&gt;378 rundate= input(date,date9.);&lt;BR /&gt;379 format rundate date9.;&lt;BR /&gt;380 drop date;&lt;BR /&gt;381 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 0 observations read from the data set FINAL.METASTAT_OUT.&lt;BR /&gt;NOTE: The data set WORK.X has 0 observations and 3 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;382&lt;BR /&gt;383 proc sort data=x out=x nodupkey;&lt;BR /&gt;384 by server rundate;&lt;BR /&gt;385 run;&lt;/P&gt;&lt;P&gt;NOTE: Input data set is empty.&lt;BR /&gt;NOTE: 0 observations with duplicate key values were deleted.&lt;BR /&gt;NOTE: The data set WORK.X has 0 observations and 3 variables.&lt;BR /&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;386&lt;BR /&gt;387&lt;BR /&gt;388 ods listing close;&lt;BR /&gt;389 ods html body='metadata_status.htm'&lt;BR /&gt;390 style=statistical;&lt;BR /&gt;NOTE: Writing HTML Body file: metadata_status.htm&lt;BR /&gt;391&lt;BR /&gt;392 proc print data=x noobs;&lt;BR /&gt;393 where rundate eq ("&amp;amp;sysdate"d);&lt;BR /&gt;SYMBOLGEN: Macro variable SYSDATE resolves to 22JAN25&lt;BR /&gt;394 run;&lt;/P&gt;&lt;P&gt;NOTE: No observations in data set WORK.X.&lt;BR /&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;395&lt;BR /&gt;396 ods html close;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 07:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/959011#M374238</guid>
      <dc:creator>Piyanka1</dc:creator>
      <dc:date>2025-02-12T07:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in PC SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/959038#M374245</link>
      <description>&lt;P&gt;I suspect you are having trouble defining your macro variables which is leading to the invalid code generation by your macros.&amp;nbsp; But it is extremely hard to follow your SAS log because of the following things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mainly because you pasted into the body of you message so it got reflowed as paragraphs and printed with proportional font.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also you seem to have placed one macro definition inside of another.&amp;nbsp; That is just going to confuse the humans that have to try and understand the code.&amp;nbsp; Unlike macro variables that can live in local symbol tables the address space for macros is flat.&amp;nbsp; So define each macro independently.&amp;nbsp; This will make the code easier to follow and make it clearer which macro variable should be local to which macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally your use of DOSUBL to try and run "side" sessions of SAS code.&amp;nbsp; You could make your flow simpler by just having the data step write the macro calls to a text file and then use %INCLUDE to run the generated code after the data step has finished.&amp;nbsp; That will make the process flow be more linear and easier to debug.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 14:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/959038#M374245</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-12T14:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in PC SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/960704#M374644</link>
      <description>&lt;P&gt;i have tried to make it simpler now by segregating this into 2 codes. but by doing that, i could see, the program fails to run. I can understand that the code could run for one macro variable but fails to run for others. Could you please help.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 09:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/960704#M374644</guid>
      <dc:creator>Piyanka1</dc:creator>
      <dc:date>2025-03-03T09:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in PC SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/960713#M374647</link>
      <description>&lt;P&gt;Once you get this ERROR the rest of the steps cannot work since the dataset it was supposed to produce is not there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="bp-text bp-text-plain hljs bp-is-scrollable" tabindex="0"&gt;&lt;CODE class="bp-text-code txt"&gt;MPRINT(META_SERVER):   RUN;
ERROR: IOM call failed.
NOTE: PROCEDURE METAOPERATE used (Total process time):&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can you run that step of the code without all of the code generation?&amp;nbsp; &amp;nbsp;If not then the macro code is generating the wrong SAS code somehow.&lt;/P&gt;
&lt;P&gt;I still do not see how DOSUBL() is doing you anything in this code.&amp;nbsp; Replace it with CALL EXECUTE().&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 13:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/960713#M374647</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-03-03T13:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in PC SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/960944#M374688</link>
      <description>&lt;P&gt;I have changed the code entirely and could generate a html report as attached here. Now i want to send this html report to users but not able to do so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the below code but it is generating an email with lots of dummy character.&lt;/P&gt;&lt;P&gt;/* Read the HTML report into a macro variable */&lt;BR /&gt;filename mymail email&lt;BR /&gt;to='ghospiya@merck.com'&lt;BR /&gt;subject='Status Report'&lt;BR /&gt;type='text/html';&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;file mymail;&lt;BR /&gt;infile "C:\Users\ghospiya\Documents\report.html" lrecl=32767 end=eof;;&lt;BR /&gt;input;&lt;BR /&gt;put _infile_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;filename mymail clear;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 14:23:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-in-PC-SAS-code/m-p/960944#M374688</guid>
      <dc:creator>Piyanka1</dc:creator>
      <dc:date>2025-03-05T14:23:07Z</dc:date>
    </item>
  </channel>
</rss>

