DATA Step, Macro, Functions and more

Urgent Help

Accepted Solution Solved
Reply
Contributor
Posts: 46
Accepted Solution

Urgent Help

4700         DATA CLAIM3;                                                       
4701           SET CLAIM2;                                                      
4702         &YEARMONTH;                                                        
WARNING: Character format specified for the result of a numeric expression.     
WARNING: Character format specified for the result of a numeric expression.     
WARNING: Character format specified for the result of a numeric expression.     
WARNING: Character format specified for the result of a numeric expression.     
4703         &AGECAT;                                                           
4704         FORMAT NETWORKCLMS NET.;                                           
4705         FORMAT PLACEOFSERVICE POS.;                                        
4706         FORMAT HOSPPROF HP.;                                               
4707         FORMAT EPBEGINDATE DATE9. EPENDDATE DATE9.;                        
4708         FORMAT TYPE $31.;                                                  
4709         &DIAGCHAP;                                                         
4710         &DIAGFORM;                                                         
4711         IF TRIM(CPTCODE) IN ('27438','27446','27447','27486','27487',      
4712         '27488','27445','27090','27091','27125','27130','27132',           
4713         '27134','27236','27137','27138','23472','23470','23473',           
4714         '23474','24363','24370','24371','25446','27702','27703',           
4715         '27704') THEN TYPE = "JOINT REPLACEMENT PROCEDURE";                
4716           ELSE IF DRGNUMBER IN                                             
4717               ('483','507','508','515','516','517','484','469','470')      
4718            OR DRGNUMBER IN ('466','467','468','469','470') THEN            
4719           TYPE = "JOINT REPLACEMENT PROCEDURE";                            
4720         ELSE IF EPBEGINDATE <= CLMBEGINDATE AND CLMBEGINDATE <= EPENDDATE  
4721          THEN TYPE = "DURING HOSPITALIZATION";                             
4722         ELSE                                                               
4723          IF CLMBEGINDATE < EPBEGINDATE THEN TYPE = "PRE-OPERATIVE CARE";   
4724          ELSE IF CLMBEGINDATE > EPENDDATE THEN DO;                         
4725          IF (TRIM(CPTCODE) IN ('97001','97002','97750','97751',            
4726                            '97752','97753','97754','97755',                
4727                            '97799') OR                                     
9                                                          The SAS System       
                                                                                
4728                          ('97010'<= TRIM(CPTCODE)<='97546' OR              
4729                            SPECCODE = '65') AND SPECCODE NE "A3"           
4730          THEN TYPE = "POST-OPERATIVE PHYSICAL THERAPY";                    
              ____ ____                                    _                    
              ____ ____                                    _                    
              ____ ____                                    _                    
              388  202                                     79                   
              388  202                                     79                   
              388  202                                     79                   
4731           ELSE TYPE = "OTHER POST-OPERATIVE CARE";                         
               ____                                                             
               ____                                                             
               ____                                                             
               160                                                              
               160                                                              
               160                                                              
ERROR 388-185: Expecting an arithmetic operator.                                
ERROR 388-185: Expecting an arithmetic operator.                                
ERROR 388-185: Expecting an arithmetic operator.                                
                                                                                
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.   
                                                                                
ERROR 79-322: Expecting a ).                                                    
ERROR 79-322: Expecting a ).                                                    
ERROR 79-322: Expecting a ).                                                    
                                                                                
ERROR 160-185: No matching IF-THEN clause.                                      
ERROR 160-185: No matching IF-THEN clause.                                      
ERROR 160-185: No matching IF-THEN clause.                                      
                                                                                
4732           END;                                                             
4733          ELSE TYPE = "OTHER";)                                             
                                  _                                             
                                  _                                             
                                  _                                             
                                  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.        
                                                                                
4734                                                                            
4735        IF PTSEXRELCODE IN('2','4','6','8','B','C')                         
4736             THEN GENDER = "FEMALE";                                        
4737             ELSE GENDER = "MALE";                                          
                 ____                                                           
                 ____                                                           
                 160                                                            
                 160                                                            
                 160                                                            
ERROR 160-185: No matching IF-THEN clause.                                      
ERROR 160-185: No matching IF-THEN clause.                                      
ERROR 160-185: No matching IF-THEN clause.                                      
                                                                                
4738         RUN;                                                               
                                                                                
NOTE: Numeric values have been converted to character values at the places given
      4709:66    4709:117                                                       
NOTE: Character values have been converted to numeric values at the places given
      4729:43   4729:55   4730:9    4730:16                                     
NOTE: The SAS System stopped processing this step because of errors.            
NOTE: SAS set option OBS=0 and will continue to check statements. This may cause
WARNING: The data set WORK.CLAIM3 may be incomplete.  When this step was stopped
NOTE: The DATA statement used 0.02 CPU seconds and 18323K.                      
                                                                                
NOTE: The address space has used a maximum of 1896K below the line and 23772K ab
                                                                                
                                                                                
                                                                                

Accepted Solutions
Solution
‎03-23-2017 11:51 PM
Super User
Posts: 19,855

Re: Urgent Help

@essdee Mark the question solved. 

View solution in original post


All Replies
Super User
Posts: 19,855

Re: Urgent Help

What's the question?

 

Contributor
Posts: 46

Re: Urgent Help

I solved it, thank you
Solution
‎03-23-2017 11:51 PM
Super User
Posts: 19,855

Re: Urgent Help

@essdee Mark the question solved. 

Trusted Advisor
Posts: 1,931

Re: Urgent Help

Well, certainly having macro variable &yearmonth that produces an error doesn't help.

 

Also, the line that begins with

 

IF (TRIM(CPTCODE)

has mismatched parenthesis, the left parenthesis in front of TRIM doesn't have a matching right parenthesis

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 280 views
  • 0 likes
  • 3 in conversation