Start of change

%PROC (Return Name of Current Procedure)

%PROC()

%PROC returns the external name of the current procedure.

%PROC can only be specified in calculation statements.

Figure 1. %PROC Example
CTL-OPT MAIN(myPgm);
DCL-S x VARCHAR(100);

DCL-PR myPgm EXTPGM('MYLIB/MYPGM345') END-PR;
DCL-PR proc1 END-PR;
DCL-PR proc2 EXTPROC('myProc2') END-PR;
DCL-PR proc3 EXTPROC(*JAVA:'MyClass':'proc3') END-PR;

DCL-PROC myPgm;  //  1 
   x = %PROC();
   // x = "MYPGM"
END-PROC;

DCL-PROC proc1;  //  2 
   x = %PROC();
   // x = "PROC1"
END-PROC;

DCL-PROC proc2;  //  3 
   x = %PROC();
   // x = "myProc2"
END-PROC;

DCL-PROC proc3 EXPORT; //  4 
   x = %PROC();
   // x = "Java_MyClass_proc3"
END-PROC;
End of change