ERROR: SYMBOLIC VARIABLE NAME PIWD.NINST_CLM_HDR MUST CONTAIN ONLY LETTERS, DIGITS AND UNDERSCORES.

Reply
Frequent Contributor
Posts: 128

ERROR: SYMBOLIC VARIABLE NAME PIWD.NINST_CLM_HDR MUST CONTAIN ONLY LETTERS, DIGITS AND UNDERSCORES.

1          ******************************************************************
2                                                                            
3            OPTIONS NODATE LS=132 OBS=MAX SORT=2430 SORTPGM=BEST            
4                    PS=59 NOBYLINE YEARCUTOFF=1920;                         
5                                                                            
6           %MACRO EXTRACT(DSO,NINST_CLM_HDR,INST_CLM_HDR,NINST_CLM_LN,      
7               INST_CLM_LN,STARTDT,ENDDT);                                     
8                                                                               
9                                                                               
10             /**EXTRACT FROM CLAIMS WAREHOUSE - NINST**/                      
2                                                          THE SAS SYSTEM       
                                                                                
11                                                                              
12                 PROC SQL;                                                    
13                   CONNECT TO DB2(SSID=DBR0);                                 
14                     EXECUTE(SET CURRENT DEGREE='ANY') BY DB2;                
15                                                                              
16                   CREATE TABLE &DSO.DATA AS                                  
17                     SELECT * FROM CONNECTION TO DB2                          
18                      (SELECT                                                 
19                         HD.SR_PRIME_RCD_DATE AS CLMRECDT,                    
20                         LN.CLM_BGN_SRVC_DT AS CLMSVCDT,                      
21                         LN.CLM_END_SRVC_DT AS CLMENDDT,                      
22                         LN.SPONSOR_SSN AS SPONSORSSN,                        
23                         LN.PATNT_AMMS_ID_NO AS PATIENTID,                    
24                         HD.PATNT_LAST_NAME AS PTLASTNAME,                    
25                         HD.PATNT_FIRST_NAME AS PTFIRSTNAME,                  
26                         HD.PATNT_DOB AS PTDOB,                               
27                         HD.PATNT_ADDR_LN_1 AS PTADD1,                        
28                         HD.PATNT_ADDR_LN_2 AS PTADD2,                        
29                         HD.PATNT_CITY AS PTCITY,                             
30                         HD.PATNT_STATE AS PTSTATE,                           
31                         HD.PATNT_ZIP_CODE AS PTZIP,                          
32                         HD.ALLOWED_CHRG AS ALLCHRG,                          
33                         LN.APRVD_AMT AS APRVDAMT,                            
34                         LN.PAYMENT_AMT AS PYMTAMT,                           
35                         HD.BLG_PRVDR_NAME AS BPROVNAME,                      
36                         HD.BLG_PRVDR_NPI AS BPROVNPI,                        
37                         HD.TAX_ID_NBR AS BPROVTIN,                           
38                         HD.BLG_PRVDR_ST_CD AS BPROVST,                       
39                         HD.BLG_PRVDR_ZIP_CD AS BPROVZIP,                     
40                         HD.BLG_PRVDR_ADDR1 AS BPROVADD1,                     
41                         HD.BLG_PRVDR_ADDR2 AS BPROVADD2,                     
42                         LN.DRVD_RNDRG_PRV_NPI AS RPROVDVDNPI,                
43                         LN.REND_PROVIDER AS RPROVNBR,                        
44                         LN.RNDRG_PRVDR_NPI AS RPROVNPI,                      
45                         LN.RNDRG_PRV_FST_NAME AS RPROVFNAME,                 
46                         LN.RNDRG_PRV_LST_NAME AS RPROVLNAME,                 
47                         HD.PAY_TO_IND AS PAYTOIND,                           
48                         HD.OHI_SUSPCTD_IND AS OHIIND,                        
49                         HD.OHI_ALLWD_AMT AS OHIALWDAMT,                      
50                         HD.TPL_ALLOW_AMT AS TPLALWDAMT,                      
51                         HD.CHK_NUMBER AS CHECKNUM,                           
52                         HD.CHK_NUMBER_2 AS CHECKNUM2,                        
53                         HD.CLM_ADJ_ID AS CLMADJID,                           
54                         HD.CLM_BASE_ID AS CLMBASEID                          
55                       FROM                                                   
56                        PIWD.&LINE LN                                         
57                             INNER JOIN                                       
58                        PIWD.&HDR  HD                                         
59                       ON                                                     
60                      (LN.CLM_BASE_ID=HD.CLM_BASE_ID AND                      
61                       LN.CLM_ADJ_ID=HD.CLM_ADJ_ID AND                        
62                       LN.CLM_TRANS_TYP=HD.CLM_TRANS_TYP                      
63                       AND LN.CHAP_CLM_SUB_NO=HD.CHAP_CLM_SUB_NO)             
64                      WHERE                                                   
65                   (LN.CLM_BGN_SRVC_DT BETWEEN &STARTDT AND &ENDDT));         
66                                                                              
67                  %PUT &SQLXMSG &SQLXRC;                                      
3                                                          THE SAS SYSTEM       
                                                                                
68                  %MEND EXTRACT;                                              
69                                                                              
70           %MACRO EXTRACT(NINST11A, PIWD.NINST_CLM_HDR,                       
ERROR: SYMBOLIC VARIABLE NAME PIWD.NINST_CLM_HDR MUST CONTAIN ONLY LETTERS, DIGITS AND UNDERSCORES.
ERROR: SYMBOLIC VARIABLE NAME PIWD.NINST_CLM_HDR MUST CONTAIN ONLY LETTERS, DIGITS AND UNDERSCORES.
ERROR: SYMBOLIC VARIABLE NAME PIWD.NINST_CLM_HDR MUST CONTAIN ONLY LETTERS, DIGITS AND UNDERSCORES.
ERROR: INVALID MACRO PARAMETER NAME PIWD.NINST_CLM_HDR.  IT SHOULD BE A VALID SA
ERROR: INVALID MACRO PARAMETER NAME PIWD.NINST_CLM_HDR.  IT SHOULD BE A VALID SA
ERROR: INVALID MACRO PARAMETER NAME PIWD.NINST_CLM_HDR.  IT SHOULD BE A VALID SA
ERROR: A DUMMY MACRO WILL BE COMPILED.                                          
ERROR: A DUMMY MACRO WILL BE COMPILED.                                          
ERROR: A DUMMY MACRO WILL BE COMPILED.                                          
Super User
Posts: 13,584

Re: ERROR: SYMBOLIC VARIABLE NAME PIWD.NINST_CLM_HDR MUST CONTAIN ONLY LETTERS, DIGITS AND UNDERSCOR

It looks like you attempted to "execute" the macro but used the wrong the form:

%MACRO EXTRACT(NINST11A, PIWD.NINST_CLM_HDR, 

is attempting to DEFINE the macro Extract and the items in a macro definition in the parameters have to be valid variable names.

 

 

Try

%EXTRACT(NINST11A, PIWD.NINST_CLM_HDR, <and the rest of the parameters>);

to execute the macro. 

Frequent Contributor
Posts: 128

Re: ERROR: SYMBOLIC VARIABLE NAME PIWD.NINST_CLM_HDR MUST CONTAIN ONLY LETTERS, DIGITS AND UNDERSCOR

Ok I fixed the PIWD.INST ... in the list of %MACROS so it seemed to work even with the MACRO statement there but now I'm getting this error:

 

67                  %PUT &SQLXMSG &SQLXRC;                                      
3                                                          THE SAS SYSTEM       
                                                                                
68                  %MEND EXTRACT;                                              
69                                                                              
70           %MACRO EXTRACT(NINST11A, NINST_CLM_HDR,                            
71             NINST_CLM_LN, '2011-04-01', '2011-06-30');                       
ERROR: INVALID MACRO PARAMETER NAME '2011-04-01'.  IT SHOULD BE A VALID SAS IDEN
ERROR: INVALID MACRO PARAMETER NAME '2011-04-01'.  IT SHOULD BE A VALID SAS IDEN
ERROR: INVALID MACRO PARAMETER NAME '2011-04-01'.  IT SHOULD BE A VALID SAS IDEN
ERROR: A DUMMY MACRO WILL BE COMPILED.                                          
ERROR: A DUMMY MACRO WILL BE COMPILED.                                          
ERROR: A DUMMY MACRO WILL BE COMPILED.                                          
72           %MACRO EXTRACT(NINST11B, NINST_CLM_HDR,                            
73             NINST_CLM_LN, '2011-07-01', '2011-12-31');                       
74           %MACRO EXTRACT(NINST12A, NINST_CLM_HDR,                            
75              NINST_CLM_LN, '2012-01-01', '2012-06-30');                      
76           %MACRO EXTRACT(NINST12B, NINST_CLM_HDR,                            
77              NINST_CLM_LN, '2012-07-01', '2012-12-31');                      
78           %MACRO EXTRACT(NINST13A, NINST_CLM_HDR,                            
79              NINST_CLM_LN, '2013-01-01', '2013-06-30');                      
80           %MACRO EXTRACT(NINST13B, NINST_CLM_HDR,                            
Super User
Posts: 23,787

Re: ERROR: SYMBOLIC VARIABLE NAME PIWD.NINST_CLM_HDR MUST CONTAIN ONLY LETTERS, DIGITS AND UNDERSCOR

You cannot execute a macro with the %macro. keyword. It thinks you're nesting macros.

You're now so deep in, you'll likely need to restart SAS or disconnect at least to get it back to where you can even try to debug this.
Ask a Question
Discussion stats
  • 3 replies
  • 52 views
  • 0 likes
  • 3 in conversation