ERRORS IN CODE

Reply
Super Contributor
Posts: 1,040

ERRORS IN CODE

Hi ,

Can someone explain to me where the issues is in the following piece of code????

Thanks

59578   *================== PROGRAM: PSI_COMPOSITE.SAS =====================;
59579   *===================================================================;
59580   *  Title:  PSI COMPOSITE CONSTRUCTS COMPOSITE MEASURE FOR
59581   *          PATIENT SAFETY INDICATORS
59582   *
59583   *  Description:
59584   *         CONSTRUCTS A COMPOSITE MEASURE BASED ON USER DEFINED
59585   *         WEIGHTS (DEFAULT IS NQF WEIGHTS)
59586   *
59587   *          >>>  VERSION 4.5A, MAY 2014 <<<
59588   *
59589   *  USER NOTE:  Make sure you have run through PSSASP3.SAS
59590   *              BEFORE running this program.
59591   *
59592   *  COMMENTS: REVISED WITH CORRECTED WEIGHTS (9-24-2013)
59593   *===================================================================;
59594   LIBNAME IN1 "C:\AHRQQI_4.5a\PSI";
NOTE: Libref IN1 refers to the same physical library as OUTA2.
NOTE: Libref IN1 was successfully assigned as follows:
      Engine:        V9
      Physical Name: C:\AHRQQI_4.5a\PSI
59595   LIBNAME OUT1 "C:\AHRQQI_4.5a\PSI";
NOTE: Libref OUT1 refers to the same physical library as IN1.
NOTE: Libref OUT1 was successfully assigned as follows:
      Engine:        V9
      Physical Name: C:\AHRQQI_4.5a\PSI
59596   FILENAME MSXC "C:\AHRQQI_4.5a\PSI\MSXPSC45A_K.TXT";
59597   FILENAME MSXCA "C:\AHRQQI_4.5a\PSI\MXPSC45AA.TXT";
59598
59599   %LET INFILE = PSP3;
59600   %LET OUTFILE = PSC3;
59601   %LET PRINT = 1;
59602
59603   %LET USEPOA = 1;
59604
59605   %MACRO PSC;
59606
59607   %IF &USEPOA. = 0 %THEN %DO;
59608      %LET MSX = MSXCA;
59609      %LET ARRY = ARRYP6;
59610   %END;
59611   %ELSE %DO;
59612      %LET MSX = MSXC;
59613      %LET ARRY = ARRYP3;
59614   %END;
59615
59616   *===================================================================;
59617   *  PATIENT SAFETY FOR SELECTED INDICATORS                         --;
59618   *  ASSIGN INDICATOR WEIGHTS                                       --;
59619   *  WEIGHTS MUST SUM TO 1.0                                      --;
59620   *===================================================================;
59621
59622   %IF &USEPOA. = 0 %THEN %DO;
59623
59624   %LET W03 = 0.2303;
59625   %LET W06 = 0.0545;
59626   %LET W07 = 0.0563;
59627   %LET W08 = 0.0025;
59628   %LET W09 = 0.0000;
59629   %LET W10 = 0.0000;
59630   %LET W11 = 0.0000;
59631   %LET W12 = 0.2572;
59632   %LET W13 = 0.0603;
59633   %LET W14 = 0.0097;
59634   %LET W15 = 0.3292;
59635
59636   %END;
59637   %ELSE %DO;
59638
59639   %LET W03 = 0.0226;
59640   %LET W06 = 0.0708;
59641   %LET W07 = 0.0652;
59642   %LET W08 = 0.0011;
59643   %LET W09 = 0.0000;
59644   %LET W10 = 0.0000;
59645   %LET W11 = 0.0000;
59646   %LET W12 = 0.2579;
59647   %LET W13 = 0.0742;
59648   %LET W14 = 0.0165;
59649   %LET W15 = 0.4917;
59650
59651   %END;
59652
59653   *===================================================================;
59654   *  COMPUTE COMPOSITE                                              --;
59655   *===================================================================;
59656
59657   DATA OUT1.&OUTFILE.(KEEP=HOSPID COMP1 COMP1VAR COMP1SE COMP1WHT COMP1LB COMP1UB);
59658   SET IN1.&INFILE.;
59659
59660   %INCLUDE &MSX.;
59661
59662   ARRAY ARRY4{11}
59663      RPPS03 RPPS06 RPPS07 RPPS08 RPPS09 RPPS10
59664      RPPS11 RPPS12 RPPS13 RPPS14 RPPS15
59665   ;
59666
59667   ARRAY ARRY6{11}
59668      VPPS03 VPPS06 VPPS07 VPPS08 VPPS09 VPPS10
59669      VPPS11 VPPS12 VPPS13 VPPS14 VPPS15
59670   ;
59671
59672   ARRAY ARRY7{11}
59673      APPS03 APPS06 APPS07 APPS08 APPS09 APPS10
59674      APPS11 APPS12 APPS13 APPS14 APPS15
59675   ;
59676
59677   ARRAY ARRY12{11} _temporary_
59678      (&W03. &W06. &W07. &W08. &W09. &W10.
59679       &W11. &W12. &W13. &W14. &W15.)
59680   ;
59681
59682   ARRAY ARRY13{11}
59683      PPPS03 PPPS06 PPPS07 PPPS08 PPPS09 PPPS10
59684      PPPS11 PPPS12 PPPS13 PPPS14 PPPS15
59685   ;
59686
59687   DO I = 1 TO 11;
59688      IF ARRY13(I) GE 3 THEN DO;
59689         ARRY6(I) = ARRY6(I) / (&ARRY.(I) * &ARRY.(I));
59690         DO J = I TO 11;
59691            IDX = ARRY10(I,J);
59692            IF I = J THEN ARRY7(I) = ARRY1(IDX) / (ARRY1(IDX) + ARRY6(I));
59693         END;
59694      END;
59695      ELSE DO;
59696         DO J = I TO 11;
59697            IDX = ARRY10(I,J);
59698            IF I = J THEN ARRY7(I) = 0;
59699         END;
59700      END;
59701   END;
59702
59703   COMP1    = 0;
59704   COMP1VAR = 0;
59705   COMP1SE  = 0;
59706   COMP1WHT = 0;
59707
59708   DO I = 1 TO 11;
59709      IF ARRY13(I) GE 3 THEN DO;
59710         COMP1 = COMP1 + (ARRY12(I) * (((ARRY4(I) / &ARRY.(I)) * ARRY7(I)) + ((1 - ARRY7(I))
59710 ! * ARRYP21 (I))));
59711
59712         COMP1WHT = COMP1WHT + (ARRY12(I) * ARRY13(I));
59713      END;
59714      ELSE DO;
59715         COMP1 = COMP1 + (ARRY12(I) * ARRYP21 (I));
59716         COMP1WHT = COMP1WHT + 0;
59717      END;
59718      DO J = I TO 11;
59719         IDX = ARRY10(I,J);
59720         IF I = J THEN COMP1VAR = COMP1VAR
59721         + (ARRY12(I) * (ARRY1(IDX) * (1 - ARRY7(I))) * ARRY12(J));
59722         ELSE COMP1VAR = COMP1VAR
59723         + (ARRY12(I) * (ARRY1(IDX) * (1 - ARRY7(I)) * (1 - ARRY7(J))) * ARRY12(J));
59724      END;
59725   END;
59726
59727   COMP1SE  = SQRT(COMP1VAR);
59728   COMP1LB  = COMP1 - 1.96* COMP1SE;
59729   COMP1UB  = COMP1 + 1.96* COMP1SE;
59730
59731
59732
59733   LABEL
59734     COMP1    = 'PSI #90 Patient Safety for Selected Indicators'
59735     COMP1VAR = 'PSI #90 Patient Safety for Selected Indicators (Variance)'
59736     COMP1SE  = 'PSI #90 Patient Safety for Selected Indicators (SE)'
59737     COMP1WHT = 'PSI #90 Patient Safety for Selected Indicators (Weighted Denominator)'
59738     COMP1LB  = 'PSI #90 Patient Safety for Selected Indicators (Lower CL)'
59739     COMP1UB  = 'PSI #90 Patient Safety for Selected Indicators (Upper CL)';
59740
59741   RUN;
59742
59743   %MEND;
59744
59745   %PSC;
NOTE: Line generated by the invoked macro "PSC".
10       0; COMP1WHT = 0;  DO I = 1 TO 11;    IF ARRY13(I) GE 3 THEN DO;       COMP1 = COMP1 +
10    ! (ARRY12(I) * (((ARRY4(I) / &ARRY.(I)) * ARRY7(I)) + ((1 - ARRY7(I)) * ARRYP21 (I))));
                                                                              -------
                                                                              68
10    !    COMP1WHT = COMP1WHT + (ARRY12(I) * ARRY13(I));    END;    ELSE DO;
NOTE: Line generated by the invoked macro "PSC".
12             COMP1 = COMP1 + (ARRY12(I) * ARRYP21 (I));       COMP1WHT = COMP1WHT + 0;    END;
                                            -------
                                            68
12    !   DO J = I TO 11;       IDX = ARRY10(I,J);       IF I = J THEN COMP1VAR = COMP1VAR       +
12    !  (ARRY12(I) * (ARRY1(IDX) * (1 - ARRY7(I))) * ARRY12(J));       ELSE

ERROR 68-185: The function ARRYP21 is unknown, or cannot be accessed.

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set OUT1.PSC3 may be incomplete.  When this step was stopped there were 0
         observations and 7 variables.
WARNING: Data set OUT1.PSC3 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.31 seconds
      user cpu time       0.00 seconds
      system cpu time     0.03 seconds
      memory              987.06k
      OS Memory           23016.00k
      Timestamp           11/07/2014 05:06:09 PM
      Step Count                        338  Switch Count  0

59796
59797   %MACRO PRT;
59798
59799   %IF &PRINT. = 1 %THEN %DO;
59800
59801   PROC MEANS DATA=OUT1.&OUTFILE. N MEAN;
59802   TITLE 'PATIENT SAFETY INDICATOR COMPOSITE';
59803   VAR COMP1 COMP1VAR COMP1SE COMP1WHT;
59804   RUN;
59805
59806   %END;
59807
59808   %MEND;
59809
59810   %PRT;

NOTE: There were 3 observations read from the data set OUT1.PSC3.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.06 seconds
      user cpu time       0.01 seconds
      system cpu time     0.00 seconds
      memory              6489.96k
      OS Memory           28156.00k
      Timestamp           11/07/2014 05:06:09 PM
      Step Count                        339  Switch Count  0

Super User
Super User
Posts: 6,842

Re: ERRORS IN CODE

So this message

ERROR 68-185: The function ARRYP21 is unknown, or cannot be accessed.

Means that you are trying to reference an array with that name that was never defined.

Ask a Question
Discussion stats
  • 1 reply
  • 174 views
  • 0 likes
  • 2 in conversation