<?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 Canot solve for SAS Email Error - Statement is not valid or it is used out of proper order in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Canot-solve-for-SAS-Email-Error-Statement-is-not-valid-or-it-is/m-p/814856#M321644</link>
    <description>&lt;P&gt;hello - I continue to get the following error:&amp;nbsp;ERROR 180-322: Statement is not valid or it is used out of proper order. I have been through this code for a day and can not correct this. The log is below, can someone please take a look&amp;nbsp;and offer any insight. I an sending an email that loops through broker managers name, then their email address and sends that managers report to them. Thank you for your help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
33         
34         GOPTIONS ACCESSIBLE;
35         %macro hex2(n);
36                                         %local digits n1 n2;
37                                         %let digits = 0123456789ABCDEF;
38                                         %let n1 = %substr(&amp;amp;digits, &amp;amp;n / 16 + 1, 1);
39                                         %let n2 = %substr(&amp;amp;digits, &amp;amp;n - &amp;amp;n / 16 * 16 + 1, 1);
40                                         &amp;amp;n1&amp;amp;n2
41         %mend hex2;
42         %macro RGB(r,g,b);
43                                         %cmpres(CX%hex2(&amp;amp;r)%hex2(&amp;amp;g)%hex2(&amp;amp;b))
44         %mend RGB;
45         
46         proc sql;
47         select distinct brokermanager into: BrokerManager1 separated by " "
48         from brokermanageremail;
49         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

50         
2                                                          The SAS System                                07:30 Tuesday, May 24, 2022

51         %macro reps1;
52         
53         %local i rep ;
54         %do i=1 %to %sysfunc(countw(&amp;amp;BrokerManager1));
55         %let rep = %scan(&amp;amp;BrokerManager1, &amp;amp;i);
56         
57         %put &amp;amp;BrokerManager1.;
58         %put &amp;amp;rep.;
59         
60         proc sql;
61         select distinct Email_Address into :Email_Address trimmed
62         from brokermanageremail
63         where BrokerManager = "&amp;amp;rep1."
64         ;quit;
65         
66         Filename myemail Clear;
67         FILENAME myemail EMAIL
68         sender=("")
69         from=("")
70         /*To = ("&amp;amp;rep_email.")*/
71         CC = ("")
72         bcc =("")
73         Subject = "Reports"
74         attach =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel");
75         content_type="text/html";
76         /*ods msoffice2k file=myemail rs=none style=htmlblue;*/
77         /*options(pagebreak="no");*/
78         data _null_;
79         	file myemail;
80         	put '&amp;lt;body style=font-size:11pt;font-family:Times New Roman&amp;gt;';
81         	put     ' &amp;lt;p&amp;gt;Hello,';
82         	put    '&amp;lt;/p&amp;gt; Please see the following attachment for an updated version of the Ready To Sell Broker Manager Report.' ;
83         	put      	'&amp;lt;p&amp;gt; This report is separated into 4 separate tabs.';
84         	put			'&amp;lt;p&amp;gt; 1. Agency Overview: A list of your sub-agencies that are populated with agents. If an agency has no agents,
84       ! that agency will not appear in this Overview.';
85         	put					'&amp;lt;p&amp;gt; a. Agency Name:';
86         	put          		'&amp;lt;p&amp;gt; b. AOR Code: of agency in column A.' ;
87         	put     			'&amp;lt;p&amp;gt; c. Level 3, Level 2 and TOH';
88         	put     					'&amp;lt;p&amp;gt; i. Indicates the level of the agency in relationship to the Top of Hierarchy agency';
89         	put					'&amp;lt;p&amp;gt; d. Agencies will have a line item row for each role in the agency (see column K) and possible a blank for
89       ! 2021';
90         	put					'&amp;lt;p&amp;gt; e. Columns O and P are contract completion and end dates';
91         	put     					'&amp;lt;p&amp;gt; i. Florida does not expire licenses, so more dates are pushed out to year 9999';
92         	put     					'&amp;lt;p&amp;gt; ii. This would be populated with a current date if the agent was terminated by request or due to
92       ! circumstances';
93         	put					'&amp;lt;p&amp;gt; g. L is the column that indicates if the agent has both AHIP and product certification training completed';
94         	put			'&amp;lt;p&amp;gt; 2. AHIP Needed: Agents for whom we have no AHIP transcripts in house, It is the receipt of these transcripts
94       ! that pushes the Product Certification training to the agents AHIP site';
95         	put     	'&amp;lt;p&amp;gt; 3. Ready to Train: Agents for whom we have AHIP on file, but they have not yet completed product
95       ! certification';
96         	put     	'&amp;lt;p&amp;gt; 4. Ready-to-Sell: Agents for whom we have received AHIP transcripts and who have successfully completed
96       ! product certification, These agents are fully certified and Read to Sell';
97         	put		'&amp;lt;p&amp;gt; If you have any questions, please reach out to the Agent Service Center at 800-267-3156, or the Florida Blue
97       ! Broker Agents mailbox at FBMBrokers@bcbsfl.com or your Local Broker Manager, based on the county you live in.';
98                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
98       ! Florida Blue Broker Agents mailbox at FBMBrokers@bcbsfl.com and include Agency Name, Agency Code, and Email Address.';
99                    '&amp;lt;p&amp;gt; Thank you for your partnership with Florida Blue Medicare';
100        	
3                                                          The SAS System                                07:30 Tuesday, May 24, 2022

101        
102        
103        run;
104        
105        /*ods msoffice2k close;*/
106        %end;
107        %mend reps1;
108        %reps1;
Key Nguyen Sierra Sweat Theodore
Key
WARNING: Apparent symbolic reference REP1 not resolved.
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: Fileref MYEMAIL has been deassigned.
NOTE: Line generated by the invoked macro "REPS1".
108         = ("") bcc =("") Subject = "Broker Manager Reports" attach
108      ! =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel"); content_type="text/html";   data
                                                                                                 ____________
                                                                                                 180
108      ! _null_;  file myemail;  put
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
                       ___________________________________________________________________________________________________________
                       180
108      !  Agents mailbox at Testemail.com and include Agency Name, Agency Code, and Email Address.';
NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; Thank you for your partnership';        run;
                       _______________________________________________________________
                       180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

Key Nguyen Sierra Sweat Theodore
Nguyen
WARNING: Apparent symbolic reference REP1 not resolved.
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: Fileref MYEMAIL has been deassigned.
NOTE: Line generated by the invoked macro "REPS1".
108         = ("") bcc =("") Subject = "Broker Manager Reports" attach
108      ! =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel"); content_type="text/html";   data
                                                                                                 ____________
4                                                          The SAS System                                07:30 Tuesday, May 24, 2022

                                                                                                 180
108      ! _null_;  file myemail;  put
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
                       ___________________________________________________________________________________________________________
                       180
108      !  Agents mailbox at testemail@bcbsfl.com and include Agency Name, Agency Code, and Email Address.';
NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; Thank you for your partnership';        run;
                       _______________________________________________________________
                       180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

Key Nguyen Sierra Sweat Theodore
Sierra
WARNING: Apparent symbolic reference REP1 not resolved.
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: Fileref MYEMAIL has been deassigned.
NOTE: Line generated by the invoked macro "REPS1".
108         = ("") bcc =("") Subject = "Broker Manager Reports" attach
108      ! =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel"); content_type="text/html";   data
                                                                                                 ____________
                                                                                                 180
108      ! _null_;  file myemail;  put
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
                       ___________________________________________________________________________________________________________
                       180
108      ! Agents mailbox at Testemal@bcbsfl.com and include Agency Name, Agency Code, and Email Address.';
NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; Thank you for your partnershi';        run;
                       _______________________________________________________________
                       180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

5                                                          The SAS System                                07:30 Tuesday, May 24, 2022

Key Nguyen Sierra Sweat Theodore
Sweat
WARNING: Apparent symbolic reference REP1 not resolved.
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: Fileref MYEMAIL has been deassigned.
NOTE: Line generated by the invoked macro "REPS1".
108         = ("") bcc =("") Subject = "Broker Manager Reports" attach
108      ! =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel"); content_type="text/html";   data
                                                                                                 ____________
                                                                                                 180
108      ! _null_;  file myemail;  put
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
                       ___________________________________________________________________________________________________________
                       180
108      ! Agents mailbox at testemail@bcbsfl.com and include Agency Name, Agency Code, and Email Address.';
NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; Thank you for your partnership';        run;
                       _______________________________________________________________
                       180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

Key Nguyen Sierra Sweat Theodore
Theodore
WARNING: Apparent symbolic reference REP1 not resolved.
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: Fileref MYEMAIL has been deassigned.
NOTE: Line generated by the invoked macro "REPS1".
108         = ("") bcc =("") Subject = "Broker Manager Reports" attach
108      ! =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel"); content_type="text/html";   data
                                                                                                 ____________
                                                                                                 180
108      ! _null_;  file myemail;  put
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
                       ___________________________________________________________________________________________________________
                       180
6                                                          The SAS System                                07:30 Tuesday, May 24, 2022

108      ! Agents mailbox at Testemail@bcbsfl.com and include Agency Name, Agency Code, and Email Address.';
NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; Thank you for your partnership';        run;
                       _______________________________________________________________
                       180

ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 May 2022 11:46:39 GMT</pubDate>
    <dc:creator>LMSSAS</dc:creator>
    <dc:date>2022-05-24T11:46:39Z</dc:date>
    <item>
      <title>Canot solve for SAS Email Error - Statement is not valid or it is used out of proper order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Canot-solve-for-SAS-Email-Error-Statement-is-not-valid-or-it-is/m-p/814856#M321644</link>
      <description>&lt;P&gt;hello - I continue to get the following error:&amp;nbsp;ERROR 180-322: Statement is not valid or it is used out of proper order. I have been through this code for a day and can not correct this. The log is below, can someone please take a look&amp;nbsp;and offer any insight. I an sending an email that loops through broker managers name, then their email address and sends that managers report to them. Thank you for your help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
33         
34         GOPTIONS ACCESSIBLE;
35         %macro hex2(n);
36                                         %local digits n1 n2;
37                                         %let digits = 0123456789ABCDEF;
38                                         %let n1 = %substr(&amp;amp;digits, &amp;amp;n / 16 + 1, 1);
39                                         %let n2 = %substr(&amp;amp;digits, &amp;amp;n - &amp;amp;n / 16 * 16 + 1, 1);
40                                         &amp;amp;n1&amp;amp;n2
41         %mend hex2;
42         %macro RGB(r,g,b);
43                                         %cmpres(CX%hex2(&amp;amp;r)%hex2(&amp;amp;g)%hex2(&amp;amp;b))
44         %mend RGB;
45         
46         proc sql;
47         select distinct brokermanager into: BrokerManager1 separated by " "
48         from brokermanageremail;
49         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

50         
2                                                          The SAS System                                07:30 Tuesday, May 24, 2022

51         %macro reps1;
52         
53         %local i rep ;
54         %do i=1 %to %sysfunc(countw(&amp;amp;BrokerManager1));
55         %let rep = %scan(&amp;amp;BrokerManager1, &amp;amp;i);
56         
57         %put &amp;amp;BrokerManager1.;
58         %put &amp;amp;rep.;
59         
60         proc sql;
61         select distinct Email_Address into :Email_Address trimmed
62         from brokermanageremail
63         where BrokerManager = "&amp;amp;rep1."
64         ;quit;
65         
66         Filename myemail Clear;
67         FILENAME myemail EMAIL
68         sender=("")
69         from=("")
70         /*To = ("&amp;amp;rep_email.")*/
71         CC = ("")
72         bcc =("")
73         Subject = "Reports"
74         attach =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel");
75         content_type="text/html";
76         /*ods msoffice2k file=myemail rs=none style=htmlblue;*/
77         /*options(pagebreak="no");*/
78         data _null_;
79         	file myemail;
80         	put '&amp;lt;body style=font-size:11pt;font-family:Times New Roman&amp;gt;';
81         	put     ' &amp;lt;p&amp;gt;Hello,';
82         	put    '&amp;lt;/p&amp;gt; Please see the following attachment for an updated version of the Ready To Sell Broker Manager Report.' ;
83         	put      	'&amp;lt;p&amp;gt; This report is separated into 4 separate tabs.';
84         	put			'&amp;lt;p&amp;gt; 1. Agency Overview: A list of your sub-agencies that are populated with agents. If an agency has no agents,
84       ! that agency will not appear in this Overview.';
85         	put					'&amp;lt;p&amp;gt; a. Agency Name:';
86         	put          		'&amp;lt;p&amp;gt; b. AOR Code: of agency in column A.' ;
87         	put     			'&amp;lt;p&amp;gt; c. Level 3, Level 2 and TOH';
88         	put     					'&amp;lt;p&amp;gt; i. Indicates the level of the agency in relationship to the Top of Hierarchy agency';
89         	put					'&amp;lt;p&amp;gt; d. Agencies will have a line item row for each role in the agency (see column K) and possible a blank for
89       ! 2021';
90         	put					'&amp;lt;p&amp;gt; e. Columns O and P are contract completion and end dates';
91         	put     					'&amp;lt;p&amp;gt; i. Florida does not expire licenses, so more dates are pushed out to year 9999';
92         	put     					'&amp;lt;p&amp;gt; ii. This would be populated with a current date if the agent was terminated by request or due to
92       ! circumstances';
93         	put					'&amp;lt;p&amp;gt; g. L is the column that indicates if the agent has both AHIP and product certification training completed';
94         	put			'&amp;lt;p&amp;gt; 2. AHIP Needed: Agents for whom we have no AHIP transcripts in house, It is the receipt of these transcripts
94       ! that pushes the Product Certification training to the agents AHIP site';
95         	put     	'&amp;lt;p&amp;gt; 3. Ready to Train: Agents for whom we have AHIP on file, but they have not yet completed product
95       ! certification';
96         	put     	'&amp;lt;p&amp;gt; 4. Ready-to-Sell: Agents for whom we have received AHIP transcripts and who have successfully completed
96       ! product certification, These agents are fully certified and Read to Sell';
97         	put		'&amp;lt;p&amp;gt; If you have any questions, please reach out to the Agent Service Center at 800-267-3156, or the Florida Blue
97       ! Broker Agents mailbox at FBMBrokers@bcbsfl.com or your Local Broker Manager, based on the county you live in.';
98                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
98       ! Florida Blue Broker Agents mailbox at FBMBrokers@bcbsfl.com and include Agency Name, Agency Code, and Email Address.';
99                    '&amp;lt;p&amp;gt; Thank you for your partnership with Florida Blue Medicare';
100        	
3                                                          The SAS System                                07:30 Tuesday, May 24, 2022

101        
102        
103        run;
104        
105        /*ods msoffice2k close;*/
106        %end;
107        %mend reps1;
108        %reps1;
Key Nguyen Sierra Sweat Theodore
Key
WARNING: Apparent symbolic reference REP1 not resolved.
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: Fileref MYEMAIL has been deassigned.
NOTE: Line generated by the invoked macro "REPS1".
108         = ("") bcc =("") Subject = "Broker Manager Reports" attach
108      ! =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel"); content_type="text/html";   data
                                                                                                 ____________
                                                                                                 180
108      ! _null_;  file myemail;  put
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
                       ___________________________________________________________________________________________________________
                       180
108      !  Agents mailbox at Testemail.com and include Agency Name, Agency Code, and Email Address.';
NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; Thank you for your partnership';        run;
                       _______________________________________________________________
                       180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

Key Nguyen Sierra Sweat Theodore
Nguyen
WARNING: Apparent symbolic reference REP1 not resolved.
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: Fileref MYEMAIL has been deassigned.
NOTE: Line generated by the invoked macro "REPS1".
108         = ("") bcc =("") Subject = "Broker Manager Reports" attach
108      ! =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel"); content_type="text/html";   data
                                                                                                 ____________
4                                                          The SAS System                                07:30 Tuesday, May 24, 2022

                                                                                                 180
108      ! _null_;  file myemail;  put
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
                       ___________________________________________________________________________________________________________
                       180
108      !  Agents mailbox at testemail@bcbsfl.com and include Agency Name, Agency Code, and Email Address.';
NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; Thank you for your partnership';        run;
                       _______________________________________________________________
                       180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

Key Nguyen Sierra Sweat Theodore
Sierra
WARNING: Apparent symbolic reference REP1 not resolved.
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: Fileref MYEMAIL has been deassigned.
NOTE: Line generated by the invoked macro "REPS1".
108         = ("") bcc =("") Subject = "Broker Manager Reports" attach
108      ! =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel"); content_type="text/html";   data
                                                                                                 ____________
                                                                                                 180
108      ! _null_;  file myemail;  put
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
                       ___________________________________________________________________________________________________________
                       180
108      ! Agents mailbox at Testemal@bcbsfl.com and include Agency Name, Agency Code, and Email Address.';
NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; Thank you for your partnershi';        run;
                       _______________________________________________________________
                       180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

5                                                          The SAS System                                07:30 Tuesday, May 24, 2022

Key Nguyen Sierra Sweat Theodore
Sweat
WARNING: Apparent symbolic reference REP1 not resolved.
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: Fileref MYEMAIL has been deassigned.
NOTE: Line generated by the invoked macro "REPS1".
108         = ("") bcc =("") Subject = "Broker Manager Reports" attach
108      ! =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel"); content_type="text/html";   data
                                                                                                 ____________
                                                                                                 180
108      ! _null_;  file myemail;  put
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
                       ___________________________________________________________________________________________________________
                       180
108      ! Agents mailbox at testemail@bcbsfl.com and include Agency Name, Agency Code, and Email Address.';
NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; Thank you for your partnership';        run;
                       _______________________________________________________________
                       180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

Key Nguyen Sierra Sweat Theodore
Theodore
WARNING: Apparent symbolic reference REP1 not resolved.
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: Fileref MYEMAIL has been deassigned.
NOTE: Line generated by the invoked macro "REPS1".
108         = ("") bcc =("") Subject = "Broker Manager Reports" attach
108      ! =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel"); content_type="text/html";   data
                                                                                                 ____________
                                                                                                 180
108      ! _null_;  file myemail;  put
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; If you would like to add anyone to the distribution list for this report, please send an email to the
                       ___________________________________________________________________________________________________________
                       180
6                                                          The SAS System                                07:30 Tuesday, May 24, 2022

108      ! Agents mailbox at Testemail@bcbsfl.com and include Agency Name, Agency Code, and Email Address.';
NOTE: Line generated by the invoked macro "REPS1".
108                    '&amp;lt;p&amp;gt; Thank you for your partnership';        run;
                       _______________________________________________________________
                       180

ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 May 2022 11:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Canot-solve-for-SAS-Email-Error-Statement-is-not-valid-or-it-is/m-p/814856#M321644</guid>
      <dc:creator>LMSSAS</dc:creator>
      <dc:date>2022-05-24T11:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Canot solve for SAS Email Error - Statement is not valid or it is used out of proper order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Canot-solve-for-SAS-Email-Error-Statement-is-not-valid-or-it-is/m-p/814857#M321645</link>
      <description>&lt;P&gt;Maybe the problem is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;73         Subject = "Reports"
74         attach =("/u/&amp;amp;sysuserid./Agency Report_&amp;amp;rep..xlsx" content_type="application/vnd.ms-excel");
75         content_type="text/html";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You have an extra semi-colon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From now on, when you have errors in a macro, turn on the macro debugging by running this command&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then run the macro again, and show us the LOG. We need to see the &lt;FONT color="#FF0000"&gt;ENTIRE&lt;/FONT&gt; log, not selected parts.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 11:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Canot-solve-for-SAS-Email-Error-Statement-is-not-valid-or-it-is/m-p/814857#M321645</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-24T11:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Canot solve for SAS Email Error - Statement is not valid or it is used out of proper order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Canot-solve-for-SAS-Email-Error-Statement-is-not-valid-or-it-is/m-p/814876#M321652</link>
      <description>&lt;P&gt;Let's look at some of your code:&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;    %let rep = %scan(&amp;amp;BrokerManager1, &amp;amp;i);
56         
57         %put &amp;amp;BrokerManager1.;
58         %put &amp;amp;rep.;
59         
60         proc sql;
61         select distinct Email_Address into :Email_Address trimmed
62         from brokermanageremail
63         where BrokerManager = "&amp;amp;rep1."&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;You define a macro variable REP. You use %put with macro variable REP. You attempt to select values of a variable from the data set with a macro variable REP1 that does not show a definition or value set anywhere.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suspect you mean to use BrokerManager= "&amp;amp;rep."&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 14:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Canot-solve-for-SAS-Email-Error-Statement-is-not-valid-or-it-is/m-p/814876#M321652</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-05-24T14:05:47Z</dc:date>
    </item>
  </channel>
</rss>

