BookmarkSubscribeRSS Feed
Sandeep77
Lapis Lazuli | Level 10

Hi Experts,

I am not able to spot the syntax error. I have used the below code earlier and it has worked but this time it is showing error. Can you please suggest?

data etpt.&Release_batch ;
set work.append_repository ; 
run; 

Error code:

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET SYSLAST=WORK.APPEND_REPOSITORY;
4          %LET _CLIENTTASKLABEL='Append to repository';
5          %LET _CLIENTPROCESSFLOWNAME='Importing stoplist checked';
6          %LET _CLIENTPROJECTPATH='S:\Trace\Trace Integrity Analyst Data\BAU_Processes\SAS\Enhanced TPT\Storage\Ad Hoc\HCE Trace -
6        ! 27-09-2022\HCE Trace Request (LIMA & TPT).egp';
7          %LET _CLIENTPROJECTPATHHOST='LWLT5CG9322XFL';
8          %LET _CLIENTPROJECTNAME='HCE Trace Request (LIMA & TPT).egp';
9          %LET _SASPROGRAMFILE='';
10         %LET _SASPROGRAMFILEHOST='';
11         
12         ODS _ALL_ CLOSE;
13         OPTIONS DEV=SVG;
14         GOPTIONS XPIXELS=0 YPIXELS=0;
15         %macro HTML5AccessibleGraphSupported;
16             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH;
17         %mend;
18         ODS LISTING GPATH=&sasworklocation;
19         FILENAME EGHTML TEMP;
20         ODS HTML5(ID=EGHTML) FILE=EGHTML
21             OPTIONS(BITMAP_MODE='INLINE')
22             %HTML5AccessibleGraphSupported
23             ENCODING='utf-8'
24             STYLE=HTMLBlue
25             NOGTITLE
26             NOGFOOTNOTE
27             GPATH=&sasworklocation
28         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
29         
30         data etpt.&Release_batch ;
NOTE: Line generated by the macro variable "RELEASE_BATCH".
30          etpt.release_HCE Trace - 27.09.2022 - v1.0
                                   _
                                   22
                                   200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  

ERROR 200-322: The symbol is not recognized and will be ignored.

31         set work.append_repository ;
32         run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set ETPT.RELEASE_HCE may be incomplete.  When this step was stopped there were 0 observations and 34 variables.
WARNING: Data set ETPT.RELEASE_HCE was not replaced because this step was stopped.
WARNING: The data set WORK.TRACE may be incomplete.  When this step was stopped there were 0 observations and 34 variables.
WARNING: Data set WORK.TRACE was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              1208.00k
      OS Memory           37352.00k
      Timestamp           10/01/2022 01:24:40 PM
      Step Count                        209  Switch Count  0
      
2                                                          The SAS System                           14:42 Friday, September 30, 2022



33         
34         %LET _CLIENTTASKLABEL=;
35         %LET _CLIENTPROCESSFLOWNAME=;
36         %LET _CLIENTPROJECTPATH=;
37         %LET _CLIENTPROJECTPATHHOST=;
38         %LET _CLIENTPROJECTNAME=;
39         %LET _SASPROGRAMFILE=;
40         %LET _SASPROGRAMFILEHOST=;
41         
42         ;*';*";*/;quit;run;
43         ODS _ALL_ CLOSE;
44         
45         
46         QUIT; RUN;
47         
2 REPLIES 2
PaigeMiller
Diamond | Level 26
30         data etpt.&Release_batch ;
NOTE: Line generated by the macro variable "RELEASE_BATCH".
30          etpt.release_HCE Trace - 27.09.2022 - v1.0

 

The macro variable &RELEASE_BATCH resolves to release_HCE Trace - 27.09.2022 - v1.0 which is not a valid name for a SAS data set. You cannot use macro variables to get around the requirement that you must have a valid SAS data set name. Your macro variable must resolve to a valid SAS data set name.

--
Paige Miller
ballardw
Super User

Several issues with

30         data etpt.&Release_batch ;
NOTE: Line generated by the macro variable "RELEASE_BATCH".
30          etpt.release_HCE Trace - 27.09.2022 - v1.0
                                   _

First is the attempt to reference any value as , I think you attempt, dataset.variable. The data set does not do that. Any use of the . in expressions other than as a decimal place tells SAS that you are attempting some form of Component language expression which are very limited.

Second is you seem to be using, from SAS viewpoint, 3 variables: release_hce, Trace and V1.0, with last an invalid name.

Third the expression seems to involve a calculation. The syntax would be : targetvariable=<some expression>; Since there is no valid target variable name or = that is another issue.

Fourth, the statement does not end in a ;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 498 views
  • 2 likes
  • 3 in conversation