DATA Step, Macro, Functions and more

SAS log errors - statement used out of proper order?

Reply
Contributor
Posts: 46

SAS log errors - statement used out of proper order?

[ Edited ]
50             DATA TARG.DATA;                                                  
51               SET TARGETF.DATA;                                             
52                       IF ('F0600' <= TRIM(DIAG) <= 'F6999' OR               
53                            'F8400' <= TRIM(DIAG) <= 'F9999' OR              
54                            'Z8650' <= TRIM(DIAG) <= 'Z8659') OR             
55                   LREVCD IN ('0114','0124','0134','0144','0154','0961')     
56                                 THEN MH = 'Y';                              
57                                 ELSE MH = 'N';                              
58                 RUN;                                                        
                                                                               
NOTE: THERE WERE 558915 OBSERVATIONS READ FROM THE DATA SET TARGETF.DATA.      
NOTE: THE DATA SET TARG.DATA HAS 558915 OBSERVATIONS AND 64 VARIABLES.         
NOTE: THE DATA STATEMENT USED 1.54 CPU SECONDS AND 14376K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 14816K ABO
                                                                               
                                                                               
59                                                                             
3                                                          THE SAS SYSTEM      
                                                                               
60            /*PROC PRINT UNIFORM DATA = TARG.DATA (OBS=25);                  
61             RUN;*/                                                          
62                                                                             
63             DATA MH ER1 OTHER0.DATA;                                        
64                SET TARG.DATA;                                               
65                                                                             
66                  IF (SRCFILE = 'N' AND                                      
67                      ('99281' <= PROCCD <= '99285' OR                       
68                       'G0380' <= PROCCD <= 'G0384') OR                      
69                      APCCODE IN ('00609','00613','00614','00615','00616',   
70                               '00626','00627','00628','00629','00630',      
71                              '05021','05022','05023','05024','05025',       
72                              '05031','05032','05033','05034','05035'))      
73                      OR                                                     
74                      (SRCFILE = 'I' AND                                     
75                       ('99281' <= HCPCS <= '99285' OR                       
76                        'G0380' <= HCPCS <= 'G0384' OR                       
77                   '0450' <= LREVCD <= '0459')   OR                          
78                    APCCODE IN ('00609','00613','00614','00615','00616',     
79                                '00626','00627','00628','00629','00630',     
80                                '05021','05022','05023','05024','05025',     
81                                '05031','05032','05033','05034','05035'))    
82              THEN OUTPUT ER1;                                               
83           ELSE                                                              
84              IF MH = 'Y' THEN OUTPUT MH; ELSE OUTPUT OTHER0.DATA;           
85              RUN;                                                           
                                                                               
NOTE: THERE WERE 558915 OBSERVATIONS READ FROM THE DATA SET TARG.DATA.         
NOTE: THE DATA SET WORK.MH HAS 46313 OBSERVATIONS AND 64 VARIABLES.            
NOTE: THE DATA SET WORK.ER1 HAS 18109 OBSERVATIONS AND 64 VARIABLES.           
NOTE: THE DATA SET OTHER0.DATA HAS 494493 OBSERVATIONS AND 64 VARIABLES.       
NOTE: THE DATA STATEMENT USED 2.41 CPU SECONDS AND 15528K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 15968K ABO
                                                                               
                                                                               
86                                                                             
87          /*   IF ROBOSPEC = 'Y'                                             
88                   THEN OUTPUT ROBOSPEC;*/                                   
89                                                                             
90               IF PROVSPEC IN ('2084D0003X','2084F0202X','2084P0015X',       
                 __                                                            
                 __                                                            
                 __                                                            
                 180                                                           
                 180                                                           
                 180                                                           
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
                                                                               
91                             '2084P0800X','2084P0802X','2084P0805X','2084S0012
92                             '2084P0804X','103T00000X','103TA0400X','103TA0700
93                             '103TC0700X','103TC1900X','103TC2200X','103TE1000
94                             '103TE1100X','103TF0000X','103TF0200X','103TH0004
95                             '103TH0100X','103TM1700X','103TM1800X','103TP0814
96                             '103TP2700X','103TP2701X','103TR0400X','103TW0100
97                             '173F00000X','104100000X','1041S0200X','106H00000
98                             '101YM0800X','364SP0807X','364SP0808X','364SP0809
99                             '364SP0810X','364SP0811X','364SP0812X','364SP0813
100               THEN SPECIALTY = 'ORTHO';                                    
                                                                               
101                   ELSE                                                     
                      ____                                                     
                      ____                                                     
                      ____                                                     
                      180                                                      
                      180                                                      
                      180                                                      
4                                                          THE SAS SYSTEM      
                                                                               
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
                                                                               
102                  IF PROVSPEC IN ('207XP3100X') THEN                        
103                    SPECIALTY = 'PEDIATRIC ORTHO';                          
                                                                               
104                   ELSE                                                     
                      ____                                                     
                      ____                                                     
                      ____                                                     
                      180                                                      
                      180                                                      
                      180                                                      
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
                                                                               
105                    SPECIALTY = 'ERROR';                                    
                                                                               
106                 RUN;                                                       
107                                                                            
108          *___ 1ST ER EXCLUSION BY SAME DOS AS PROF SERVICES DATASET;       
109                                                                            
110           PROC SORT NODUPKEY DATA = ER1 (KEEP = BENE LBEGDT) OUT = ER1B;   
111              BY BENE LBEGDT;                                               
112           RUN;                                                             
                                                                               
NOTE: SAS SET OPTION OBS=0 AND WILL CONTINUE TO CHECK STATEMENTS. THIS MAY CAUSE
NOTE: THE DATA SET WORK.ER1B HAS 0 OBSERVATIONS AND 0 VARIABLES.               
NOTE: THE PROCEDURE SORT USED 0.00 CPU SECONDS AND 14778K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 15968K ABO
                                                                               
                                                                               
113                                                                            
114           PROC SORT DATA = MH;                                             
115              BY BENE LBEGDT;                                               
116           RUN;                                                             
                                                                               
NOTE: THE PROCEDURE SORT USED 0.00 CPU SECONDS AND 14778K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 15968K ABO
                                                                               
                                                                               
117                                                                            
118           DATA MH1;                                                        
119              MERGE MH (IN = INA)                                           
120                    ER1B  (IN = INB);                                       
121                 BY BENE LBEGDT;                                            
122                 IF INA AND NOT INB;                                        
123           RUN;                                                             
                                                                               
NOTE: THE DATA SET WORK.MH1 HAS 0 OBSERVATIONS AND 64 VARIABLES.               
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 14906K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 15968K ABO
                                                                               
                                                                               
124                                                                            
125         *___ 2ND ER EXCLUSION WHERE ER CLAIM DATE IS BETWEEN               
126                INPATIENT HOSPITAL PROF SERVICES' RELATED INSTITUTIONAL     
127                ADMISSIONS                                                  
128                                                                            
129                FIND INSTITUTIONAL ADMISSIONS FOR PROF;                     
130                                                                            
5                                                          THE SAS SYSTEM      
                                                                               
131           DATA PFINST1;                                                    
132             SET OTHER0.DATA;                                               
133                                                                            
134                IF SRCFILE = 'I' AND                                        
135                   LPOS = '21';                                             
136                                                                            
137                IF MISSING(DSCSVCDT) OR DSCSVCDT = '31DEC9999'D             
138                      THEN DO;                                              
139                          IF HENDDT = ADMSVCDT                              
140                              THEN DSCSVCDT = ADMSVCDT + 1;                 
141                          ELSE DSCSVCDT = HENDDT;                           
142                       END;                                                 
143                                                                            
144           RUN;                                                             
                                                                               
NOTE: THE DATA SET WORK.PFINST1 HAS 0 OBSERVATIONS AND 64 VARIABLES.           
NOTE: THE DATA STATEMENT USED 0.01 CPU SECONDS AND 14403K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 15968K ABO
                                                                               
145                                                                            
146          PROC SORT DATA = PFINST1;                                         
147               BY BENE ADMSVCDT DESCENDING DSCSVCDT;                        
148            RUN;                                                            
                                                                               
NOTE: THE PROCEDURE SORT USED 0.00 CPU SECONDS AND 14403K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 15968K ABO
                                                                               
                                                                               
149                                                                            
150            DATA PFINST2;                                                   
151               SET PFINST1;                                                 
152               BY BENE ADMSVCDT DESCENDING DSCSVCDT;                        
153                                                                            
154                  IF FIRST.ADMSVCDT;                                        
155                                                                            
156            RUN;                                                            
                                                                               
NOTE: THE DATA SET WORK.PFINST2 HAS 0 OBSERVATIONS AND 64 VARIABLES.           
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 14403K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 15968K ABO
                                                                               
                                                                               
157                                                                            
158         *___ BUMP PROF SERVICES AGAINST INST TO FIND INPATIENT HOSPITAL    
159               PROF SERVICES WITH AN ADMISSION PERIOD;                      
160                                                                            
161          PROC SQL;                                                         
162             CREATE TABLE PFINST3 (SORTEDBY = _NULL_)                       
163                AS SELECT DISTINCT B.*                                      
164                FROM MH AS A, PFINST2 AS B                                  
165                WHERE A.BENE = B.BENE AND                                   
166                      A.LBEGDT BETWEEN B.ADMSVCDT AND B.DSCSVCDT AND        
167                      A.PLSERV = 'INPATIENT HOSPITAL';                      
6                                                          THE SAS SYSTEM      
                                                                               
NOTE: TABLE WORK.PFINST3 CREATED, WITH 0 ROWS AND 64 COLUMNS.                  
                                                                               
168                                                                            
169          *___ BUMP INST DATASET AGAINST ER TO FIND ER CLAIMS W/IN INST     
170               DATASET'S ADMISSION PERIOD TO EXCLUDE FROM RPT2 (PROF);      
171                                                                            
NOTE: THE PROCEDURE SQL USED 0.01 CPU SECONDS AND 16522K.                      
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
172          PROC SQL;                                                         
173             CREATE TABLE ER2 (SORTEDBY = _NULL_)                           
174                AS SELECT DISTINCT B.*                                      
175                FROM ER1 AS A, PFINST3 AS B                                 
176                WHERE A.BENE = B.BENE AND                                   
177                      B.ADMSVCDT <= A.LBEGDT <= B.DSCSVCDT;                 
NOTE: TABLE WORK.ER2 CREATED, WITH 0 ROWS AND 64 COLUMNS.                      
                                                                               
178                                                                            
179           *___ 2ND ER EXCLUSION BY ADMISSION PERIOD FOR INPATIENT          
180                 HOSPITAL PROF CLAIMS;                                      
181                                                                            
NOTE: THE PROCEDURE SQL USED 0.01 CPU SECONDS AND 16522K.                      
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
182            PROC SORT NODUPKEY DATA = ER2 (KEEP = BENE ADMSVCDT DSCSVCDT    
183             LBEGDT) OUT = ER2B;                                            
184               BY BENE ADMSVCDT DSCSVCDT;                                   
185            RUN;                                                            
                                                                               
NOTE: THE DATA SET WORK.ER2B HAS 0 OBSERVATIONS AND 0 VARIABLES.               
NOTE: THE PROCEDURE SORT USED 0.00 CPU SECONDS AND 15242K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
186                                                                            
187            *___ FINAL PROF DATASET WITH ER EXCLUSIONS;                     
188                                                                            
189          PROC SQL;                                                         
190             CREATE TABLE EXCL1  (SORTEDBY = _NULL_)                        
191                AS SELECT DISTINCT A.CLMNBR,A.CLMLN                         
192                FROM MH1 AS A, ER2B AS B                                    
193                WHERE A.BENE = B.BENE AND                                   
194                      A.LBEGDT BETWEEN B.ADMSVCDT AND B.DSCSVCDT;           
ERROR: TABLE WORK.ER2B DOESN'T HAVE ANY COLUMNS. PROC SQL REQUIRES EACH OF ITS T
ERROR: TABLE WORK.ER2B DOESN'T HAVE ANY COLUMNS. PROC SQL REQUIRES EACH OF ITS T
ERROR: TABLE WORK.ER2B DOESN'T HAVE ANY COLUMNS. PROC SQL REQUIRES EACH OF ITS T
ERROR: COLUMN BENE COULD NOT BE FOUND IN THE TABLE/VIEW IDENTIFIED WITH THE CORR
ERROR: COLUMN BENE COULD NOT BE FOUND IN THE TABLE/VIEW IDENTIFIED WITH THE CORR
ERROR: COLUMN BENE COULD NOT BE FOUND IN THE TABLE/VIEW IDENTIFIED WITH THE CORR
ERROR: COLUMN ADMSVCDT COULD NOT BE FOUND IN THE TABLE/VIEW IDENTIFIED WITH THE
ERROR: COLUMN ADMSVCDT COULD NOT BE FOUND IN THE TABLE/VIEW IDENTIFIED WITH THE
ERROR: COLUMN ADMSVCDT COULD NOT BE FOUND IN THE TABLE/VIEW IDENTIFIED WITH THE
ERROR: COLUMN DSCSVCDT COULD NOT BE FOUND IN THE TABLE/VIEW IDENTIFIED WITH THE
ERROR: COLUMN DSCSVCDT COULD NOT BE FOUND IN THE TABLE/VIEW IDENTIFIED WITH THE
ERROR: COLUMN DSCSVCDT COULD NOT BE FOUND IN THE TABLE/VIEW IDENTIFIED WITH THE
ERROR: EXPRESSION USING BETWEEN HAS COMPONENTS THAT ARE OF DIFFERENT DATA TYPES.
ERROR: EXPRESSION USING BETWEEN HAS COMPONENTS THAT ARE OF DIFFERENT DATA TYPES.
ERROR: EXPRESSION USING BETWEEN HAS COMPONENTS THAT ARE OF DIFFERENT DATA TYPES.
NOTE: PROC SQL SET OPTION NOEXEC AND WILL CONTINUE TO CHECK THE SYNTAX OF STATEM
195                                                                            
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.           
NOTE: THE PROCEDURE SQL USED 0.00 CPU SECONDS AND 15242K.                      
7                                                          THE SAS SYSTEM      
                                                                               
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
196          PROC SORT NODUPKEY DATA = EXCL1 (KEEP=CLMNBR CLMLN);              
ERROR: FILE WORK.EXCL1.DATA DOES NOT EXIST.                                    
ERROR: FILE WORK.EXCL1.DATA DOES NOT EXIST.                                    
ERROR: FILE WORK.EXCL1.DATA DOES NOT EXIST.                                    
197            BY CLMNBR CLMLN;                                                
ERROR: NO DATA SET OPEN TO LOOK UP VARIABLES.                                  
ERROR: NO DATA SET OPEN TO LOOK UP VARIABLES.                                  
ERROR: NO DATA SET OPEN TO LOOK UP VARIABLES.                                  
ERROR: NO DATA SET OPEN TO LOOK UP VARIABLES.                                  
ERROR: NO DATA SET OPEN TO LOOK UP VARIABLES.                                  
ERROR: NO DATA SET OPEN TO LOOK UP VARIABLES.                                  
198          RUN;                                                              
                                                                               
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.           
NOTE: THE PROCEDURE SORT USED 0.00 CPU SECONDS AND 15242K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
199                                                                            
                                                                               
                                                                               
200          PROC SORT DATA = MH1;                                             
201           BY CLMNBR CLMLN;                                                 
202          RUN;                                                              
                                                                               
NOTE: THE PROCEDURE SORT USED 0.00 CPU SECONDS AND 15242K.                     
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
203                                                                            
204          DATA MH2;                                                         
205             MERGE MH1   (IN = INA)                                         
206                   EXCL1    (IN = INB);                                     
ERROR: FILE WORK.EXCL1.DATA DOES NOT EXIST.                                    
ERROR: FILE WORK.EXCL1.DATA DOES NOT EXIST.                                    
ERROR: FILE WORK.EXCL1.DATA DOES NOT EXIST.                                    
207                BY CLMNBR CLMLN;                                            
208                IF INA AND NOT INB;                                         
209          RUN;                                                              
                                                                               
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.           
WARNING: THE DATA SET WORK.MH2 MAY BE INCOMPLETE.  WHEN THIS STEP WAS STOPPED TH
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 15498K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
                                                                               
210                                                                            
211          PROC PRINT DATA = MH2 (OBS=25);                                   
212           TITLE'OBS FOR MH2 BEFORE SPLITTING OUT INTO OPPS AND NONOPPS';   
213          RUN;                                                              
                                                                               
NOTE: THE PROCEDURE PRINT USED 0.01 CPU SECONDS AND 15770K.                    
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
214                                                                            
8                                                          THE SAS SYSTEM      
                                                                               
215            *___ BACKFILL ADMISSION DATES WHEN THEY ARE MISSING ;           
216                                                                            
217            DATA ADMITDT1 (KEEP=BENE ADMSVCDT DSCSVCDT);                    
218              SET TARGETF.DATA (KEEP=BENE ADMSVCDT DSCSVCDT HENDDT);        
219              WHERE NOT MISSING(ADMSVCDT);                                  
220                                                                            
221              IF MISSING(DSCSVCDT) OR DSCSVCDT = '31DEC9999'D               
222                   THEN DSCSVCDT = HENDDT + 1;                              
223             RUN;                                                           
                                                                               
NOTE: THE DATA SET WORK.ADMITDT1 HAS 0 OBSERVATIONS AND 3 VARIABLES.           
NOTE: THE DATA STATEMENT USED 0.01 CPU SECONDS AND 15770K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
224                                                                            
225              PROC SORT DATA=ADMITDT1 OUT=ADMITDT2;                         
226                BY BENE ADMSVCDT DESCENDING DSCSVCDT;                       
227              RUN;                                                          
                                                                               
NOTE: THE DATA SET WORK.ADMITDT2 HAS 0 OBSERVATIONS AND 0 VARIABLES.           
NOTE: THE PROCEDURE SORT USED 0.00 CPU SECONDS AND 15770K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
228                                                                            
229              DATA ADMITDT;                                                 
230                 SET ADMITDT2;                                              
231                 BY BENE ADMSVCDT DESCENDING DSCSVCDT;                      
232                                                                            
233              /* KEEP THE LAST DISCHARGE DATE FOR EACH ADMISSION */         
234              /* IN THE CASE THAT THERE IS MORE THAN ONE - THIS  */         
235              /* SOMETIMES HAPPENS WHEN BACKFILLING THE CLAIM    */         
236              /* END DATE IF THE ADMISSION SPANS > 1 MONTH.      */         
237                                                                            
238              IF FIRST.BENE OR FIRST.ADMSVCDT;                              
239              RUN;                                                          
                                                                               
NOTE: THE DATA SET WORK.ADMITDT HAS 0 OBSERVATIONS AND 0 VARIABLES.            
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 15770K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
240                                                                            
241            /* WE NOW HAVE A LIST OF ADMIT AND DISCHARGE DATES.  */         
242            /* ADD ONTO ICU DATA IF IT IS NOT ALREADY THERE.     */         
243                                                                            
244            PROC SQL;                                                       
245               CREATE TABLE MHTEMP AS                                       
246                 SELECT                                                     
247                   A.*,                                                     
248                   B.ADMSVCDT AS ADMITDATE2                                 
249                 FROM                                                       
250                   MH2 AS A, ADMITDT AS B                                   
9                                                          THE SAS SYSTEM      
                                                                               
251                 WHERE A.BENE = B.BENE                                      
252                       AND A.LBEGDT BETWEEN B.ADMSVCDT = ADMITDATE2;        
                                                          _                    
                                                          _                    
                                                          _                    
                                                          22                   
                                                          22                   
                                                          22                   
                                                            __________         
                                                            __________         
                                                            __________         
                                                            202                
                                                            202                
                                                            202                
ERROR 22-322: SYNTAX ERROR, EXPECTING ONE OF THE FOLLOWING: !!, *, **, +, -, /,
ERROR 22-322: SYNTAX ERROR, EXPECTING ONE OF THE FOLLOWING: !!, *, **, +, -, /,
ERROR 22-322: SYNTAX ERROR, EXPECTING ONE OF THE FOLLOWING: !!, *, **, +, -, /,
ERROR 202-322: THE OPTION OR PARAMETER IS NOT RECOGNIZED AND WILL BE IGNORED.  
ERROR 202-322: THE OPTION OR PARAMETER IS NOT RECOGNIZED AND WILL BE IGNORED.  
ERROR 202-322: THE OPTION OR PARAMETER IS NOT RECOGNIZED AND WILL BE IGNORED.  
                                                                               
NOTE: PROC SQL SET OPTION NOEXEC AND WILL CONTINUE TO CHECK THE SYNTAX OF STATEM
253                 QUIT;                                                      
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.           
NOTE: THE PROCEDURE SQL USED 0.00 CPU SECONDS AND 15785K.                      
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
254                                                                            
                                                                               
                                                                               
255                 DATA MHTEMP2 (DROP=ADMITDATE2);                            
256                   SET MHTEMP;                                              
ERROR: FILE WORK.MHTEMP.DATA DOES NOT EXIST.                                   
ERROR: FILE WORK.MHTEMP.DATA DOES NOT EXIST.                                   
ERROR: FILE WORK.MHTEMP.DATA DOES NOT EXIST.                                   
257                   IF MISSING(ADMSVCDT) THEN ADMSVCDT = ADMITDATE2;         
258                 RUN;                                                       
                                                                               
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.           
WARNING: THE DATA SET WORK.MHTEMP2 MAY BE INCOMPLETE.  WHEN THIS STEP WAS STOPPE
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 15785K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
                                                                               
259                                                                            
260                 /*REMOVING ANY DUPLICATED CLAIM-LINE COMBOS IN CASE*/      
261                 /*THE JOIN ABOVE ADDED SOME.                       */      
262                                                                            
263            PROC SORT NODUPKEY DATA=MHTEMP2 OUT=NH3;                        
264              BY CLMNBR CLMLN;                                              
ERROR: VARIABLE CLMNBR NOT FOUND.                                              
ERROR: VARIABLE CLMNBR NOT FOUND.                                              
ERROR: VARIABLE CLMNBR NOT FOUND.                                              
ERROR: VARIABLE CLMLN NOT FOUND.                                               
ERROR: VARIABLE CLMLN NOT FOUND.                                               
ERROR: VARIABLE CLMLN NOT FOUND.                                               
265            RUN;                                                            
                                                                               
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.           
WARNING: THE DATA SET WORK.NH3 MAY BE INCOMPLETE.  WHEN THIS STEP WAS STOPPED TH
NOTE: THE PROCEDURE SORT USED 0.00 CPU SECONDS AND 15785K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
266                                                                            
267            *___ ID MH AND OTHER DATA;                                      
268            *___ ORTHOPEDICS, PEDIATRIC ORTHOPEDICS;                        
269                                                                            
                                                                               
270            DATA SPECDATA.DATA;                                             
271            LENGTH SPECIALTY $30.;                                          
10                                                         THE SAS SYSTEM      
                                                                               
272              SET MH3;                                                      
ERROR: FILE WORK.MH3.DATA DOES NOT EXIST.                                      
ERROR: FILE WORK.MH3.DATA DOES NOT EXIST.                                      
ERROR: FILE WORK.MH3.DATA DOES NOT EXIST.                                      
273                                                                            
274               SPECIALTY = 'INPATIENT MENTAL HEALTH';                       
275             RUN;                                                           
                                                                               
ERROR: THE NOREPLACE FUNCTION IS NOT SUPPORTED BY THE V9TAPE ENGINE.           
ERROR: THE NOREPLACE FUNCTION IS NOT SUPPORTED BY THE V9TAPE ENGINE.           
ERROR: THE NOREPLACE FUNCTION IS NOT SUPPORTED BY THE V9TAPE ENGINE.           
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.           
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 15805K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
                                                                               
276                                                                            
277             DATA OTHER.DATA;                                               
278             LENGTH SPECIALTY $20.;                                         
279               SET OTHER0.DATA;                                             
280                 SPECIALTY = 'NON-SPECIALTIES DATA';                        
281                 RUN;                                                       
                                                                               
ERROR: THE NOREPLACE FUNCTION IS NOT SUPPORTED BY THE V9TAPE ENGINE.           
ERROR: THE NOREPLACE FUNCTION IS NOT SUPPORTED BY THE V9TAPE ENGINE.           
ERROR: THE NOREPLACE FUNCTION IS NOT SUPPORTED BY THE V9TAPE ENGINE.           
NOTE: THE DATA STATEMENT USED 0.01 CPU SECONDS AND 15805K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
282                                                                            
283            PROC FREQ DATA = SPECDATA.DATA;                                 
284               TABLES PROVSPEC*SPECIALTY;                                   
285               RUN;                                                         
                                                                               
NOTE: THE PROCEDURE FREQ USED 0.00 CPU SECONDS AND 16348K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
286                                                                            
287               IF PROVSPEC IN ('2084D0003X','2084F0202X','2084P0015X',      
                  __                                                           
                  __                                                           
                  __                                                           
                  180                                                          
                  180                                                          
                  180                                                          
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
288                   '2084P0800X','2084P0802X','2084P0805X','2084S0012X',     
289                           '2084P0804X','103T00000X','103TA0400X','103TA0700X
290                           '103TC0700X','103TC1900X','103TC2200X','103TE1000X
291                           '103TE1100X','103TF0000X','103TF0200X','103TH0004X
292                           '103TH0100X','103TM1700X','103TM1800X','103TP0814X
293                           '103TP2700X','103TP2701X','103TR0400X','103TW0100X
294                           '173F00000X','104100000X','1041S0200X','106H00000X
295                           '101YM0800X','364SP0807X','364SP0808X','364SP0809X
296                           '364SP0810X','364SP0811X','364SP0812X','364SP0813X
297                                                                            
298              THEN SPECIALTY = 'MH';                                        
                                                                               
299                ELSE                                                        
                   ____                                                        
                   ____                                                        
                   ____                                                        
                   180                                                         
                   180                                                         
                   180                                                         
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
300                 SPECIALTY = 'ERROR';                                       
11                                                         THE SAS SYSTEM      
                                                                               
                                                                               
301              RUN;                                                          
302                                                                            
303            DATA OTHER.DATA;                                                
304            LENGTH SPECIALTY $20.;                                          
305              SET OTHER0.DATA;                                              
306               SPECIALTY = 'NON-SPECIALTIES DATA';                          
307             RUN;                                                           
                                                                               
ERROR: THE NOREPLACE FUNCTION IS NOT SUPPORTED BY THE V9TAPE ENGINE.           
ERROR: THE NOREPLACE FUNCTION IS NOT SUPPORTED BY THE V9TAPE ENGINE.           
ERROR: THE NOREPLACE FUNCTION IS NOT SUPPORTED BY THE V9TAPE ENGINE.           
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 16348K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
308                                                                            
309            PROC FREQ DATA = SPECDATA.DATA;                                 
310             TABLES PROVSPEC*SPECIALTY;                                     
311             RUN;                                                           
                                                                               
NOTE: THE PROCEDURE FREQ USED 0.00 CPU SECONDS AND 16348K.                     
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
                                                                               
312                                                                            
ERROR: ERRORS PRINTED ON PAGES 3,4,6,7,9,10,11.                                
ERROR: ERRORS PRINTED ON PAGES 3,4,6,7,9,10,11.                                
ERROR: ERRORS PRINTED ON PAGES 3,4,6,7,9,10,11.                                
                                                                               
NOTE: THE SAS SESSION USED 4.07 CPU SECONDS AND 17244K.                        
                                                                               
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 16980K ABO
                                                                               
NOTE: SAS INSTITUTE INC., SAS CAMPUS DRIVE, CARY, NC USA 27513-2414            
******************************** Bottom of Data ********************************
                                                                               
                                                                               
Super User
Posts: 5,441

Re: No Observations

Ok...So what is the question?
By just showing the code and not the log you can't expect anyone to easily help.
Data never sleeps
Contributor
Posts: 46

Re: No Observations

I edited the question

PROC Star
Posts: 283

Re: No Observations

I think you are missing a closing parenthesis and a closing quote here:

 

 IF PROVSPEC IN ('2084D0003X','2084F0202X','2084P0015X',        
                 __                                                            
                 __                                                            
                 __                                                            
                 180                                                           
                 180                                                           
                 180                                                           
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.       
                                                                               
91                             '2084P0800X','2084P0802X','2084P0805X','2084S0012
92                             '2084P0804X','103T00000X','103TA0400X','103TA0700
93                             '103TC0700X','103TC1900X','103TC2200X','103TE1000
94                             '103TE1100X','103TF0000X','103TF0200X','103TH0004
95                             '103TH0100X','103TM1700X','103TM1800X','103TP0814
96                             '103TP2700X','103TP2701X','103TR0400X','103TW0100
97                             '173F00000X','104100000X','1041S0200X','106H00000
98                             '101YM0800X','364SP0807X','364SP0808X','364SP0809
99                             '364SP0810X','364SP0811X','364SP0812X','364SP0813')/*look here i edited*/
100               THEN SPECIALTY = 'ORTHO'; 
Trusted Advisor
Posts: 1,586

Re: No Observations

Posted in reply to novinosrin

Looking at the original post, I see two first steps worked fine (log lines 50-86);

The log miss the beginning of step 3 - it can't start with (log line 90)

IF PROVSPEC IN ('2084D0003X','2084F0202X','2084P0015X',  

 therefore you got the error:

ERROR 180-322: STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER.

If you fix that and still have errors please post both code and log of the specific fault step. 

Contributor
Posts: 46

Re: No Observations

Posted in reply to novinosrin

there's already a parenthesis

Super User
Posts: 7,868

Re: No Observations

[ Edited ]

You have a RUN in line 85. That terminates the data step, so that the IF (that SAS complains about) comes outside of a data step. I guess that the RUN statement was not meant to be there.

 

Edit: Since the data step immediately before the error contains output statements, and I see no output in the following code before the next RUN, those statements that SAS complains about would be useless. So I now think that the beginning of a new data step (DATA and SET statements) is missing.

 

Edit #2: The same happens in log lines 285ff. A RUN terminates a datastep and is followed by statements not allowed in "open code".

You also have a wrongly built WHERE condition in line 251:

AND A.LBEGDT BETWEEN B.ADMSVCDT = ADMITDATE2

The errors after line 194 should be continuation errors from the first problem.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 6 replies
  • 171 views
  • 0 likes
  • 5 in conversation