BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kiteulf
Quartz | Level 8

I have files like this:

 

Test_1_1

Test_1_2

Test_1_3

Test_1_4

Test_2_1

Test_2_2

Test_2_3

Test_2_4  

 

etc...

 

I need to do a nested loop and can I use both the variables s and j to call up each file?

 

%macro sloop;

%do s= 1 %to 2;
do j= 1 to 5;

filename out_pipe "\\xxxx_&s_&j..xml" ;

 

 


DATA Test4_SME_&s_&j ;
set Temp2.Test_&s_&j;

 

<various code for handeling the data and modifying it>

run;


%END;
%MEND SLOOP;
%SLOOP;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
set Temp2.DK_PANDE3_SME_&s_&j;

This resolves to &s_1 when &j = 1. There is no macro variable by that name.

 

To tell SAS that &s is a macro variable by itself, and the macro variable name does not continue with _&j, you must use a dot to indicate the end of the macro variable name.

 

set Temp2.DK_PANDE3_SME_&s._&j;
--
Paige Miller

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

I need to do a nested loop and can I use both the variables s and j to call up each file?

 

Yes.

 

One problem with the code you show is that it need two %DO loops. You have one %DO loop and one DO loop, which won't work here.

--
Paige Miller
Kiteulf
Quartz | Level 8

I did some changes:

 

%macro sloop;

%do s= 1 %to 2;
%do j= 1 %to 5;

filename out_pipe "\\xxxx_&s_&j..xml" ;

 

 


DATA test_&s_&j ;
set Temp2.test_&s_&j;


%END;%END;
%MEND SLOOP;
%SLOOP;

 

However it says:

 

test_&s_1
_
22
200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.

PaigeMiller
Diamond | Level 26

Please show us the log. First, turn on the proper option by putting this command at the top of your code and then run it again.

 

options mprint;

Show us the entire log (not selected portions) for this macro by copying it as text and pasting it into the window that appears when you click on the </> icon, this formats the log properly. I will not try to decipher logs that are not formatted properly.

--
Paige Miller
Kiteulf
Quartz | Level 8
1                                                          The SAS System                            13:19 Friday, February 26, 2021

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='RDW-174  DenmarkCreditBureau_Felix';
4          %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5          %LET _CLIENTPROJECTPATH='\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\Colosas SAS prosjekter\RDWs.egp';
6          %LET _CLIENTPROJECTPATHHOST='ZLE02763';
7          %LET _CLIENTPROJECTNAME='RDWs.egp';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=SVG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         %macro HTML5AccessibleGraphSupported;
15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH;
16         %mend;
17         FILENAME EGHTML TEMP;
18         ODS HTML5(ID=EGHTML) FILE=EGHTML
19             OPTIONS(BITMAP_MODE='INLINE')
20             %HTML5AccessibleGraphSupported
21             ENCODING='utf-8'
22             STYLE=HTMLBlue
23             NOGTITLE
24             NOGFOOTNOTE
25             GPATH=&sasworklocation
26         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27         
28         
29         options mprint;
30         
31         
32         %macro sloop;
33         		
34         		    %do s= 1 %to 2;
35         		    %do j= 1 %to 5;
36         
37         filename out_pipe  "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917
37       ! CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&&s_&j..xml" ;
38         
39         
40         
41         
42         
43         
44         DATA DK_PANDE4_SME_&s_&j ;
45         set Temp2.DK_PANDE3_SME_&s_&j;
46         
47         
48         %END;%END;
49         %MEND SLOOP;
50         %SLOOP;
WARNING: Apparent symbolic reference S_1 not resolved.
MPRINT(SLOOP):   filename out_pipe "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917 
CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&s_1.xml" ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
2                                                          The SAS System                            13:19 Friday, February 26, 2021

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   DATA DK_PANDE4_SME_&s_1 ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
              KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   set Temp2.DK_PANDE3_SME_&s_1;
ERROR: File TEMP2.DK_PANDE3_SME_.DATA does not exist.
WARNING: Apparent symbolic reference S_2 not resolved.
MPRINT(SLOOP):   filename out_pipe "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917 
CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&s_2.xml" ;
WARNING: Apparent symbolic reference S_ not resolved.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DK_PANDE4_SME_ may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.DK_PANDE4_SME_ was not replaced because this step was stopped.
WARNING: The data set WORK.S_1 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.S_1 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   DATA DK_PANDE4_SME_&s_2 ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
              KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   set Temp2.DK_PANDE3_SME_&s_2;
ERROR: File TEMP2.DK_PANDE3_SME_.DATA does not exist.
WARNING: Apparent symbolic reference S_3 not resolved.
MPRINT(SLOOP):   filename out_pipe "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917 
CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&s_3.xml" ;
WARNING: Apparent symbolic reference S_ not resolved.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DK_PANDE4_SME_ may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.DK_PANDE4_SME_ was not replaced because this step was stopped.
WARNING: The data set WORK.S_2 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.S_2 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
3                                                          The SAS System                            13:19 Friday, February 26, 2021

      

22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   DATA DK_PANDE4_SME_&s_3 ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
              KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   set Temp2.DK_PANDE3_SME_&s_3;
ERROR: File TEMP2.DK_PANDE3_SME_.DATA does not exist.
WARNING: Apparent symbolic reference S_4 not resolved.
MPRINT(SLOOP):   filename out_pipe "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917 
CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&s_4.xml" ;
WARNING: Apparent symbolic reference S_ not resolved.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DK_PANDE4_SME_ may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.DK_PANDE4_SME_ was not replaced because this step was stopped.
WARNING: The data set WORK.S_3 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.S_3 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   DATA DK_PANDE4_SME_&s_4 ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
              KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   set Temp2.DK_PANDE3_SME_&s_4;
ERROR: File TEMP2.DK_PANDE3_SME_.DATA does not exist.
WARNING: Apparent symbolic reference S_5 not resolved.
MPRINT(SLOOP):   filename out_pipe "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917 
CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&s_5.xml" ;
WARNING: Apparent symbolic reference S_ not resolved.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DK_PANDE4_SME_ may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.DK_PANDE4_SME_ was not replaced because this step was stopped.
WARNING: The data set WORK.S_4 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
4                                                          The SAS System                            13:19 Friday, February 26, 2021

WARNING: Data set WORK.S_4 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   DATA DK_PANDE4_SME_&s_5 ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
              KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   set Temp2.DK_PANDE3_SME_&s_5;
ERROR: File TEMP2.DK_PANDE3_SME_.DATA does not exist.
WARNING: Apparent symbolic reference S_1 not resolved.
MPRINT(SLOOP):   filename out_pipe "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917 
CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&s_1.xml" ;
WARNING: Apparent symbolic reference S_ not resolved.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DK_PANDE4_SME_ may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.DK_PANDE4_SME_ was not replaced because this step was stopped.
WARNING: The data set WORK.S_5 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.S_5 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   DATA DK_PANDE4_SME_&s_1 ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
              KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   set Temp2.DK_PANDE3_SME_&s_1;
ERROR: File TEMP2.DK_PANDE3_SME_.DATA does not exist.
WARNING: Apparent symbolic reference S_2 not resolved.
MPRINT(SLOOP):   filename out_pipe "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917 
CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&s_2.xml" ;
WARNING: Apparent symbolic reference S_ not resolved.
5                                                          The SAS System                            13:19 Friday, February 26, 2021

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DK_PANDE4_SME_ may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.DK_PANDE4_SME_ was not replaced because this step was stopped.
WARNING: The data set WORK.S_1 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.S_1 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   DATA DK_PANDE4_SME_&s_2 ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
              KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   set Temp2.DK_PANDE3_SME_&s_2;
ERROR: File TEMP2.DK_PANDE3_SME_.DATA does not exist.
WARNING: Apparent symbolic reference S_3 not resolved.
MPRINT(SLOOP):   filename out_pipe "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917 
CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&s_3.xml" ;
WARNING: Apparent symbolic reference S_ not resolved.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DK_PANDE4_SME_ may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.DK_PANDE4_SME_ was not replaced because this step was stopped.
WARNING: The data set WORK.S_2 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.S_2 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   DATA DK_PANDE4_SME_&s_3 ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
              KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   set Temp2.DK_PANDE3_SME_&s_3;
ERROR: File TEMP2.DK_PANDE3_SME_.DATA does not exist.
6                                                          The SAS System                            13:19 Friday, February 26, 2021

WARNING: Apparent symbolic reference S_4 not resolved.
MPRINT(SLOOP):   filename out_pipe "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917 
CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&s_4.xml" ;
WARNING: Apparent symbolic reference S_ not resolved.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DK_PANDE4_SME_ may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.DK_PANDE4_SME_ was not replaced because this step was stopped.
WARNING: The data set WORK.S_3 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.S_3 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   DATA DK_PANDE4_SME_&s_4 ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
              KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   set Temp2.DK_PANDE3_SME_&s_4;
ERROR: File TEMP2.DK_PANDE3_SME_.DATA does not exist.
WARNING: Apparent symbolic reference S_5 not resolved.
MPRINT(SLOOP):   filename out_pipe "\\colosas001\SAS_NORWAY\Risk\B2C Secured\Playground\Sverre\DATA RISK\20200917 
CreditBureauXMLs\XMLrun\Output\DK\SME_DK_&s_5.xml" ;
WARNING: Apparent symbolic reference S_ not resolved.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DK_PANDE4_SME_ may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.DK_PANDE4_SME_ was not replaced because this step was stopped.
WARNING: The data set WORK.S_4 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.S_4 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   DATA DK_PANDE4_SME_&s_5 ;
WARNING: Apparent symbolic reference S_ not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
              KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
200: LINE and COLUMN cannot be determined.
7                                                          The SAS System                            13:19 Friday, February 26, 2021

NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 200-322: The symbol is not recognized and will be ignored.
MPRINT(SLOOP):   set Temp2.DK_PANDE3_SME_&s_5;
ERROR: File TEMP2.DK_PANDE3_SME_.DATA does not exist.
51         
52         %LET _CLIENTTASKLABEL=;
53         %LET _CLIENTPROCESSFLOWNAME=;
54         %LET _CLIENTPROJECTPATH=;
55         %LET _CLIENTPROJECTPATHHOST=;
56         %LET _CLIENTPROJECTNAME=;
57         %LET _SASPROGRAMFILE=;
58         %LET _SASPROGRAMFILEHOST=;
59         
60         ;*';*";*/;quit;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.
WARNING: The data set WORK.DK_PANDE4_SME_ may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.DK_PANDE4_SME_ was not replaced because this step was stopped.
WARNING: The data set WORK.S_5 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.S_5 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

61         ODS _ALL_ CLOSE;
62         
63         
64         QUIT; RUN;
65         
PaigeMiller
Diamond | Level 26
set Temp2.DK_PANDE3_SME_&s_&j;

This resolves to &s_1 when &j = 1. There is no macro variable by that name.

 

To tell SAS that &s is a macro variable by itself, and the macro variable name does not continue with _&j, you must use a dot to indicate the end of the macro variable name.

 

set Temp2.DK_PANDE3_SME_&s._&j;
--
Paige Miller

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1521 views
  • 1 like
  • 2 in conversation