<?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: ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGK in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714440#M19775</link>
    <description>&lt;P&gt;Did you (wrongly) add quotation marks around&amp;nbsp;&lt;FONT face="courier new,courier"&gt;afcapetown&lt;/FONT&gt;?&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2021 22:02:21 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2021-01-26T22:02:21Z</dc:date>
    <item>
      <title>ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGKONG,</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714282#M19769</link>
      <description>&lt;PRE&gt;9                                                          The SAS System                        Tuesday 26 January 2021 04:11:00 PM

215        %let etls_resetRestart = 1;
216        
10                                                         The SAS System                        Tuesday 26 January 2021 04:11:00 PM

217        /****************************************************************************
218         * Job:             VDARL_PostgresTest                    A5LWFIG5.BR0000B5 *
219         * Description:     Pushing s3 data into Postgres                           *
220         *                                                                          *
221         * Metadata Server: ndgmcdf.co.za                                 *
222         * Port:            8561                                                  *
223         * Location:        /Shared Data/UAT/ECC/Test                               *
224         *                                                                          *
225         * Server:          SASApp                                A5LWFIG5.AT000002 *
226         *                                                                          *
227         * Generated on:    Tuesday 26 January 2021 4:31:42 PM                      *
228         * Generated by:    unknown                                                          *
229         * Version:         SAS Data Integration Studio 4.905                       *
230         ****************************************************************************/
231        
232        /* Generate the process id for job  */
233        %put Process ID: &amp;amp;SYSJOBID;
Process ID: 32303
234        
235        /* General macro variables  */
236        %let jobID = %quote(A5LWFIG5.BR0000B5);
237        %let etls_jobName = %nrquote(VDARL_PostgresTest);
238        %let etls_userID = %nrquote(unknown);
239        
240        %global applName;
241        data _null_;
242        applName="SAS Data Integration Studio";
243        call symput('applName',%nrstr(applName));
244        run;

NOTE: PROCEDURE| _DISARM|         STOP| _DISARM| 2021-01-26T16:31:43,293+02:00| _DISARM| WorkspaceServer| _DISARM| | _DISARM| | 
      _DISARM| | _DISARM| 10915840| _DISARM| 11| _DISARM| 11| _DISARM| 0| _DISARM| 400| _DISARM| | _DISARM| | _DISARM| | _DISARM| | 
      _DISARM| | _DISARM| | _ENDDISARM 
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

245        /* Performance Statistics require ARM_PROC sub-system   */
246        %macro etls_startPerformanceStats;
247           %log4sas();
248           %log4sas_logger(Perf.ARM, 'level=info');
249           options armagent=log4sas armsubsys=(ARM_PROC);
250           %global _armexec;
251           %let _armexec = 1;
252           %perfinit(applname="&amp;amp;applName");
253           %global etls_recnt;
254           %let etls_recnt=-1;
255        %mend;
256        %etls_startPerformanceStats;
MPRINT(LOG4SAS):   ;
MPRINT(ETLS_STARTPERFORMANCESTATS):  ;
MPRINT(ETLS_STARTPERFORMANCESTATS):  ;
MPRINT(ETLS_STARTPERFORMANCESTATS):   options armagent=log4sas armsubsys=(ARM_PROC);
MPRINT(PERFINIT):   options notes nosource nosource2 nosymbolgen nomprint nomlogic
MPRINT(PERFINIT):   NOSYMBOLGEN ;
MPRINT(PERFINIT):  ;
MPRINT(ETLS_STARTPERFORMANCESTATS):  ;
11                                                         The SAS System                        Tuesday 26 January 2021 04:11:00 PM

257        
258        %macro etls_setArmagent;
259           %let armagentLength = %length(%sysfunc(getoption(armagent)));
260           %if (&amp;amp;armagentLength eq 0) %then
261              %do;
262                 %log4sas();
263                 %log4sas_logger(Perf.ARM, 'level=info');
264                 options armagent=log4sas armsubsys=(ARM_PROC);
265              %end;
266        %mend etls_setArmagent;
267        
268        %macro etls_setPerfInit;
269           %if "&amp;amp;_perfinit" eq "0" %then
270              %do;
271                 %etls_setArmagent;
272                 %global _armexec;
273                 %let _armexec = 1;
274                 %perfinit(applname="&amp;amp;applName");
275              %end;
276        %mend etls_setPerfInit;
277        
278        /* Setup to capture return codes  */
279        %global job_rc trans_rc sqlrc;
280        %let sysrc=0;
281        %let job_rc = 0;
282        %let trans_rc = 0;
283        %let sqlrc = 0;
284        %let syscc = 0;
285        %global etls_stepStartTime;
286        /* initialize syserr to 0 */
287        data _null_; run;

NOTE: PROCEDURE| _DISARM|         STOP| _DISARM| 2021-01-26T16:31:43,297+02:00| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| | 
      _DISARM| 11444224| _DISARM| 10915840| _DISARM| 11| _DISARM| 11| _DISARM| 0| _DISARM| 512| _DISARM| 0.000000| _DISARM| 
      0.000650| _DISARM| 1927290703.296902| _DISARM| 1927290703.297552| _DISARM| 0.000000| _DISARM| | _ENDDISARM 
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

288        
289        %macro rcSet(error);
290           %if (&amp;amp;error gt &amp;amp;trans_rc) %then
291              %let trans_rc = &amp;amp;error;
292           %if (&amp;amp;error gt &amp;amp;job_rc) %then
293              %let job_rc = &amp;amp;error;
294        %mend rcSet;
295        
296        %macro rcSetDS(error);
297           if &amp;amp;error gt input(symget('trans_rc'),12.) then
298              call symput('trans_rc',trim(left(put(&amp;amp;error,12.))));
299           if &amp;amp;error gt input(symget('job_rc'),12.) then
300              call symput('job_rc',trim(left(put(&amp;amp;error,12.))));
301        %mend rcSetDS;
302        
303        /* Setup for capturing job status  */
304        %let etls_startTime = %sysfunc(datetime(),datetime.);
305        %let etls_recordsBefore = 0;
12                                                         The SAS System                        Tuesday 26 January 2021 04:11:00 PM

306        %let etls_recordsAfter = 0;
307        %let etls_lib = 0;
308        %let etls_table = 0;
309        
310        %global etls_debug;
311        %macro etls_setDebug;
312           %if %str(&amp;amp;etls_debug) ne 0 %then
313              OPTIONS MPRINT%str(;);
314        %mend;
315        %etls_setDebug;
MPRINT(ETLS_SETDEBUG):   OPTIONS MPRINT;
316        
317        
13                                                         The SAS System                        Tuesday 26 January 2021 04:11:00 PM

318        /*==========================================================================*
319         * Step:            Download File From Amazon S3          A5LWFIG5.$0001742 *
320         * Transform:       Download File From Amazon S3                            *
321         * Description:     Downloads a file from Amazon S3.                        *
322         *==========================================================================*/
323        
324        %let transformID = %quote(A5LWFIG5.$0001742);
325        %let trans_rc = 0;
326        %let etls_stepStartTime = %sysfunc(datetime(), datetime20.);
327        
328        /* Runtime statistics macros  */
329        %etls_setPerfInit;
330        %perfstrt(txnname=%BQUOTE(_DISARM|&amp;amp;transformID|&amp;amp;syshostname|GeneratedTransform), metrNam6=_DISROWCNT, metrDef6=Count32)
330      !  ;
MPRINT(PERFSTRT):   options notes nosource nosource2 nosymbolgen nomprint nomlogic
MPRINT(PERFSTRT):   NOSYMBOLGEN ;
MPRINT(PERFSTRT):  ;
MPRINT(PERFSTRT):  ;
331        
332        %let _INPUT_count = 0;
333        %let _OUTPUT_count = 0;
334        
335        %let etls_useConfig = %nrquote(No);
336        %let etls_s3Config = ;
337        %let etls_awsRegion = %nrquote(af-south-1);
338        %let etls_awsAccessKeyId = %nrquote(xxxxxsdxsd" secret="ddbfbhjvjsdjnsdn" region=af-south-1 get );
339        %let etls_awsSecretKey = %nrquoteddbfbhjvjsdjnsdn);
340        %let etls_enableSSL = %nrquote(Yes);
341        %let etls_s3inputFile = %nrquote(/inputfile);
342        %let etls_outputFile = %nrquote(output);
343        %let etls_outputFile_server = %nrquote(SASApp - Logical Workspace Server);
344        %let etls_outputFileReplace = %nrquote(Yes);
345        
346        %global etls_s3inputFile;
347        %let etls_fileExist=FALSE;
348        %let quotelenmax_option=%sysfunc(getoption(quotelenmax));
349        options noquotelenmax;
350        
351        %macro checkTargetFileExist();
352        
353        %if %upcase(&amp;amp;etls_outputFileReplace.) eq NO %then %do;
354        
355           data _null_;
356              if fileexist("&amp;amp;etls_outputFile.") then
357                 call symputx('etls_fileExist','Yes');
358              else
359                 call symputx('etls_fileExist','No');
360           run;
361        
362        %end;
363        
364        %mend;
365        %checkTargetFileExist();
366        
367        
368        %macro etls_procS3();
369        
370        %if (%upcase(&amp;amp;etls_outputFileReplace.) eq YES) or
14                                                         The SAS System                        Tuesday 26 January 2021 04:11:00 PM

371            (%upcase(&amp;amp;etls_outputFileReplace.) eq NO and %upcase(&amp;amp;etls_fileExist.) eq NO) %then %do;
372        
373           %if %upcase(&amp;amp;etls_useConfig.) eq YES %then %do;
374              proc s3 config="&amp;amp;etls_s3Config.";
375              get "&amp;amp;etls_s3inputFile." "&amp;amp;etls_outputFile.";
376              run;
377           %end;
378           %else %do;
379              %if %upcase(&amp;amp;etls_enableSSL.) eq YES %then %do;
380                 %let ssl=;
381              %end;
382              %else %do;
383                 %let ssl = NOSSL;
384              %end;
385        
386              proc s3 keyid="&amp;amp;etls_awsAccessKeyId."
387                      secret="&amp;amp;etls_awsSecretKey."
388                      &amp;amp;ssl.
389                      region=&amp;amp;etls_awsRegion.;
390              get "&amp;amp;etls_s3inputFile." "&amp;amp;etls_outputFile.";
391              run;
392           %end;
393        %end;
394        %else %do;
395           %if (%upcase(&amp;amp;etls_outputFileReplace.) eq NO and %upcase(&amp;amp;etls_fileExist.) eq YES) %then %do;
396              %put WARNING: 'Replace output file' option set to "&amp;amp;etls_outputFileReplace." and output file "&amp;amp;etls_outputFile."
396      ! exists.;
397              %put WARNING- S3 File: "&amp;amp;etls_s3inputFile.".  Local file: "&amp;amp;etls_outputFile.";
398              %put WARNING- The output file "&amp;amp;etls_outputFile." will not be replaced.;
399           %end;
400        %end;
401        
402        %mend;
403        %etls_procS3();
NOTE: Line generated by the macro variable "ETLS_AWSREGION".
403        af-south-1
           __
           22
            __
            76
MPRINT(ETLS_PROCS3):   proc s3 keyid="xxxxxsdxsd" secret="ddbfbhjvjsdjnsdn" region=af-south-1 get 
"inputfile" "outputfile";
MPRINT(ETLS_PROCS3):   run;

ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGKONG, APINDIA, APOSAKA, APSEOUL, 
              APSINGAPORE, APSYDNEY, APTOKYO, CACENTRAL, CNBEIJING, CNNINGXIA, EUFRANKFURT, EUIRELAND, EULONDON, EUMILAN, EUPARIS, 
              EUSTOCKHOLM, FIPS, MEBAHRAIN, SA, USEAST, USEASTOH, USGOV, USSTD, USWEST, USWESTCA.  

ERROR 76-322: Syntax error, statement will be ignored.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE| _DISARM|         STOP| _DISARM| 2021-01-26T16:31:43,726+02:00| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| | 
      _DISARM| 11444224| _DISARM| 10915840| _DISARM| 11| _DISARM| 11| _DISARM| 0| _DISARM| 536| _DISARM| 0.000000| _DISARM| 
      0.000366| _DISARM| 1927290703.725750| _DISARM| 1927290703.726116| _DISARM| 0.000000| _DISARM| | _ENDDISARM 
NOTE: PROCEDURE S3 used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      
15                                                         The SAS System                        Tuesday 26 January 2021 04:11:00 PM

404        
405        options &amp;amp;quotelenmax_option;
406        
407        
408        %rcSet(&amp;amp;syserr);
409        %rcSet(&amp;amp;sysrc);
410        %rcSet(&amp;amp;sqlrc);
411        
412        %perfstop(metrVal6=%sysfunc(max(&amp;amp;etls_recnt,-1)));
MPRINT(PERFSTOP):   options notes nosource nosource2 nosymbolgen nomprint nomlogic
NOTE: _DISARM|A5LWFIG5.$0001742|jdgsassapprd1|GeneratedTransform| _DISARM|         STOP| _DISARM| 2021-01-26T16:31:43,727+02:00| 
      _DISARM| SAS_Data_Integration_Studio| _DISARM| SAS| _DISARM| -1| _DISARM| 11444224| _DISARM| 10915840| _DISARM| 11| _DISARM| 
      11| _DISARM| 24| _DISARM| 560| _DISARM| 0.000000| _DISARM| 0.003465| _DISARM| 1927290703.723747| _DISARM| 1927290703.727212| 
      _DISARM| 0.000000| _DISARM| | _ENDDISARM 
MPRINT(PERFSTOP):   NOSYMBOLGEN ;
MPRINT(PERFSTOP):  ;
MPRINT(PERFSTOP):  ;
413        %let etls_recnt=-1;
414        
415        
416        
417        /** Step end Download File From Amazon S3 **/
418        
419        
16                                                         The SAS System                        Tuesday 26 January 2021 04:11:00 PM

420        %let etls_endTime = %sysfunc(datetime(),datetime.);
421        
422        /* Turn off performance statistics collection  */


423        data _null_;
424           if "&amp;amp;_perfinit" eq "1" then
425              call execute('%perfend;');
426        
427        run;

MPRINT(PERFEND):   options notes nosource nosource2 nosymbolgen nomprint nomlogic ;
MPRINT(PERFEND):  ;
MPRINT(PERFEND):  ;
MPRINT(PERFEND):   options NOTES SOURCE NOSOURCE2 MPRINT NOMLOGIC NOSYMBOLGEN ;
MPRINT(PERFEND):  ;
MPRINT(PERFEND):  ;
NOTE: PROCEDURE| _DISARM|         STOP| _DISARM| 2021-01-26T16:31:44,233+02:00| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| | 
      _DISARM| 11444224| _DISARM| 10915840| _DISARM| 11| _DISARM| 11| _DISARM| 0| _DISARM| 560| _DISARM| 0.000000| _DISARM| 
      0.001203| _DISARM| | _DISARM| 1927290704.233731| _DISARM| 0.000000| _DISARM| | _ENDDISARM 
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: CALL EXECUTE generated line.
1         + options notes nosource nosource2 nosymbolgen nomprint nomlogic ;;;     options NOTES SOURCE NOSOURCE2 MPRINT NOMLOGIC 
NOSYMBOLGEN ;;;;
428        &lt;/PRE&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to download a file from an s3 bucket in amazon using DI Studio. I've created a job to download the file from the bucket, however I get errors when I run the job; the error states the following :&amp;nbsp;&lt;FONT size="2"&gt;"ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGKONG, APINDIA, APOSAKA, APSEOUL, APSINGAPORE, APSYDNEY, APTOKYO, CACENTRAL, CNBEIJING, CNNINGXIA, EUFRANKFURT, EUIRELAND, EULONDON, EUMILAN, EUPARIS, EUSTOCKHOLM, FIPS, MEBAHRAIN, SA, USEAST, USEASTOH, USGOV, USSTD, USWEST, USWESTCA"&lt;/FONT&gt;. I'm using the awsregion "af-south-1" and that's where the job fails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8"&gt;@Community_Help&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 15:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714282#M19769</guid>
      <dc:creator>Gweeks</dc:creator>
      <dc:date>2021-01-26T15:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGK</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714333#M19770</link>
      <description>&lt;P&gt;Seem like there are at least two errors in these %LET statements:&lt;/P&gt;
&lt;PRE&gt;338        %let etls_awsAccessKeyId = %nrquote(xxxxxsdxsd" secret="ddbfbhjvjsdjnsdn" region=af-south-1 get );
339        %let etls_awsSecretKey = %nrquoteddbfbhjvjsdjnsdn);&lt;/PRE&gt;
&lt;P&gt;The first has unmatched quotation marks. The second has mismatched parentheses. Since these are used in the same PROC call as&amp;nbsp; etls_awsRegion, you should fix those errors first.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 17:42:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714333#M19770</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-01-26T17:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGK</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714419#M19771</link>
      <description>&lt;PRE&gt;*****************************************************************/ 

/* Generate the process id for job  */ 
%put Process ID: &amp;amp;SYSJOBID;

/* General macro variables  */ 
%let jobID = %quote(A5LWFIG5.BR0000B5);
%let etls_jobName = %nrquote(VDARL_PostgresTest);
%let etls_userID = %nrquote(unknown);

%global applName;
data _null_;
applName="SAS Data Integration Studio";
call symput('applName',%nrstr(applName));
run;
/* Performance Statistics require ARM_PROC sub-system   */ 
%macro etls_startPerformanceStats;
   %log4sas();
   %log4sas_logger(Perf.ARM, 'level=info');
   options armagent=log4sas armsubsys=(ARM_PROC);
   %global _armexec;
   %let _armexec = 1;
   %perfinit(applname="&amp;amp;applName");
   %global etls_recnt;
   %let etls_recnt=-1;
%mend;
%etls_startPerformanceStats;

%macro etls_setArmagent;
   %let armagentLength = %length(%sysfunc(getoption(armagent)));
   %if (&amp;amp;armagentLength eq 0) %then
      %do;
         %log4sas();
         %log4sas_logger(Perf.ARM, 'level=info');
         options armagent=log4sas armsubsys=(ARM_PROC);
      %end;
%mend etls_setArmagent;

%macro etls_setPerfInit;
   %if "&amp;amp;_perfinit" eq "0" %then 
      %do;
         %etls_setArmagent;
         %global _armexec;
         %let _armexec = 1;
         %perfinit(applname="&amp;amp;applName");
      %end;
%mend etls_setPerfInit; 

/* Setup to capture return codes  */ 
%global job_rc trans_rc sqlrc;
%let sysrc=0;
%let job_rc = 0;
%let trans_rc = 0;
%let sqlrc = 0;
%let syscc = 0;
%global etls_stepStartTime; 
/* initialize syserr to 0 */ 
data _null_; run;

%macro rcSet(error); 
   %if (&amp;amp;error gt &amp;amp;trans_rc) %then 
      %let trans_rc = &amp;amp;error;
   %if (&amp;amp;error gt &amp;amp;job_rc) %then 
      %let job_rc = &amp;amp;error;
%mend rcSet; 

%macro rcSetDS(error); 
   if &amp;amp;error gt input(symget('trans_rc'),12.) then 
      call symput('trans_rc',trim(left(put(&amp;amp;error,12.))));
   if &amp;amp;error gt input(symget('job_rc'),12.) then 
      call symput('job_rc',trim(left(put(&amp;amp;error,12.))));
%mend rcSetDS; 

/* Setup for capturing job status  */ 
%let etls_startTime = %sysfunc(datetime(),datetime.);
%let etls_recordsBefore = 0;
%let etls_recordsAfter = 0;
%let etls_lib = 0;
%let etls_table = 0;

%global etls_debug; 
%macro etls_setDebug; 
   %if %str(&amp;amp;etls_debug) ne 0 %then 
      OPTIONS MPRINT%str(;); 
%mend; 
%etls_setDebug; 

/*==========================================================================* 
 * Step:            Download File From Amazon S3          A5LWFIG5.BU0000KU * 
 * Transform:       Download File From Amazon S3                            * 
 * Description:     Downloads a file from Amazon S3.                        * 
 *==========================================================================*/ 

%let transformID = %quote(A5LWFIG5.BU0000KU);
%let trans_rc = 0;
%let etls_stepStartTime = %sysfunc(datetime(), datetime20.); 

/* Runtime statistics macros  */ 
%etls_setPerfInit;
%perfstrt(txnname=%BQUOTE(_DISARM|&amp;amp;transformID|&amp;amp;syshostname|GeneratedTransform), metrNam6=_DISROWCNT, metrDef6=Count32)   ;

%let _INPUT_count = 0; 
%let _OUTPUT_count = 0; 

%let etls_useConfig = %nrquote(No);
%let etls_s3Config = ;
%let etls_awsRegion = %nrquote(af-south-1);
%let etls_awsAccessKeyId = %nrquote(accesskeyid);
%let etls_awsSecretKey = %nrquote(secretkey);
%let etls_enableSSL = %nrquote(Yes);
%let etls_s3inputFile = %nrquote(/inputfile);
%let etls_outputFile = %nrquote(/outputfile);
%let etls_outputFile_server = %nrquote(SASApp - Logical Workspace Server);
%let etls_outputFileReplace = %nrquote(Yes);

%global etls_s3inputFile;
%let etls_fileExist=FALSE;
%let quotelenmax_option=%sysfunc(getoption(quotelenmax));
options noquotelenmax;

%macro checkTargetFileExist();

%if %upcase(&amp;amp;etls_outputFileReplace.) eq NO %then %do;

   data _null_;
      if fileexist("&amp;amp;etls_outputFile.") then
         call symputx('etls_fileExist','Yes');
      else
         call symputx('etls_fileExist','No');
   run;

%end;

%mend;
%checkTargetFileExist();


%macro etls_procS3();

%if (%upcase(&amp;amp;etls_outputFileReplace.) eq YES) or 
    (%upcase(&amp;amp;etls_outputFileReplace.) eq NO and %upcase(&amp;amp;etls_fileExist.) eq NO) %then %do; 

   %if %upcase(&amp;amp;etls_useConfig.) eq YES %then %do;
      proc s3 config="&amp;amp;etls_s3Config.";
      get "&amp;amp;etls_s3inputFile." "&amp;amp;etls_outputFile.";
      run;
   %end;
   %else %do;
      %if %upcase(&amp;amp;etls_enableSSL.) eq YES %then %do;
         %let ssl=;
      %end;
      %else %do;
         %let ssl = NOSSL;
      %end;

      proc s3 keyid="&amp;amp;etls_awsAccessKeyId." 
              secret="&amp;amp;etls_awsSecretKey."
              &amp;amp;ssl.
              region=&amp;amp;etls_awsRegion.;
      get "&amp;amp;etls_s3inputFile." "&amp;amp;etls_outputFile.";
      run;
   %end;
%end;
%else %do;
   %if (%upcase(&amp;amp;etls_outputFileReplace.) eq NO and %upcase(&amp;amp;etls_fileExist.) eq YES) %then %do;   
      %put WARNING: 'Replace output file' option set to "&amp;amp;etls_outputFileReplace." and output file "&amp;amp;etls_outputFile." exists.;
      %put WARNING- S3 File: "&amp;amp;etls_s3inputFile.".  Local file: "&amp;amp;etls_outputFile.";
      %put WARNING- The output file "&amp;amp;etls_outputFile." will not be replaced.;
   %end;
%end;

%mend;
%etls_procS3();

options &amp;amp;quotelenmax_option;


%rcSet(&amp;amp;syserr); 
%rcSet(&amp;amp;sysrc); 
%rcSet(&amp;amp;sqlrc); 

%perfstop(metrVal6=%sysfunc(max(&amp;amp;etls_recnt,-1)));
%let etls_recnt=-1;



/** Step end Download File From Amazon S3 **/

%let etls_endTime = %sysfunc(datetime(),datetime.);

/* Turn off performance statistics collection  */ 
data _null_;
   if "&amp;amp;_perfinit" eq "1" then 
      call execute('%perfend;');
      
run;&lt;/PRE&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; i've also added the code that the sas job runs for a clearer picture as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 21:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714419#M19771</guid>
      <dc:creator>Gweeks</dc:creator>
      <dc:date>2021-01-26T21:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGK</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714421#M19772</link>
      <description>&lt;P&gt;Good luck. I'm sure someone will be able to help you debug your macro.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 21:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714421#M19772</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-01-26T21:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGK</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714428#M19773</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/258212"&gt;@Gweeks&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have never used PROC S3, but my understanding of the documentation is that the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=proc&amp;amp;docsetTarget=n1volodm4xnj3xn1s99poiemcha2.htm&amp;amp;locale=en#n08ya03ojzha7xn1dv9s9lq72k2z" target="_blank" rel="noopener"&gt;REGION= option&lt;/A&gt; should be specified as&lt;/P&gt;
&lt;PRE&gt;region=&lt;STRONG&gt;afcapetown&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;instead of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;region=&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;af-south-1&lt;/FONT&gt;. This is also consistent with the error message.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, the errors in the two %LET statements indicated by &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684" target="_blank" rel="noopener"&gt;Rick_SAS&lt;/A&gt; need to be corrected as well.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 21:31:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714428#M19773</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-01-26T21:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGK</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714436#M19774</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I've done the changes recommended by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; and also changed the region to "afcapetown". And it's still giving me the same error message as before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOTE: Line generated by the macro variable "ETLS_AWSREGION".
617        "afcapetown"
           _
           22
            _
            200
MPRINT(ETLS_PROCS3):   proc s3 keyid="keyid" secret="secret" region="afcapetown";
MPRINT(ETLS_PROCS3):   get "/input" 
"/output";
MPRINT(ETLS_PROCS3):   run;

ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGKONG, APINDIA, APOSAKA, APSEOUL, 
              APSINGAPORE, APSYDNEY, APTOKYO, CACENTRAL, CNBEIJING, CNNINGXIA, EUFRANKFURT, EUIRELAND, EULONDON, EUMILAN, EUPARIS, 
              EUSTOCKHOLM, FIPS, MEBAHRAIN, SA, USEAST, USEASTOH, USGOV, USSTD, USWEST, USWESTCA.  

ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 21:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714436#M19774</guid>
      <dc:creator>Gweeks</dc:creator>
      <dc:date>2021-01-26T21:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGK</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714440#M19775</link>
      <description>&lt;P&gt;Did you (wrongly) add quotation marks around&amp;nbsp;&lt;FONT face="courier new,courier"&gt;afcapetown&lt;/FONT&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 22:02:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714440#M19775</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-01-26T22:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGK</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714441#M19776</link>
      <description>&lt;P&gt;So without the added quotation marks, it isn't able to identify the "object" or the directory we're trying to read the data from&lt;/P&gt;&lt;P&gt;, that's the error it gives. So I had to add in the quotation marks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 22:06:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714441#M19776</guid>
      <dc:creator>Gweeks</dc:creator>
      <dc:date>2021-01-26T22:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Syntax error, expecting one of the following: a quoted string, AFCAPETOWN, APHONGK</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714445#M19777</link>
      <description>&lt;P&gt;The documentation does not mention quotes around the "&lt;SPAN&gt;PROC S3 Region Values," that's why I think they should be omitted. It says, however,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"You might need to activate a region for your account if it does not appear in your list of regions. See your AWS documentation for more information."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Maybe this is the reason why &lt;FONT face="courier new,courier"&gt;afcapetown&lt;/FONT&gt; is not (yet) available to your system. Another reason might be the SAS release: In my offline help file (I'm using SAS 9.4M5) there's no African region listed at all, i.e., &lt;FONT face="courier new,courier"&gt;afcapetown&lt;/FONT&gt;&amp;nbsp;seems to be a recent addition in 9.4M6 or later.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sorry, this is pretty much all I can contribute to this thread, having never used PROC S3 or the AWS S3 environment.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 22:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/ERROR-22-322-Syntax-error-expecting-one-of-the-following-a/m-p/714445#M19777</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-01-26T22:33:00Z</dc:date>
    </item>
  </channel>
</rss>

