You are on page 1of 3

how do you handle exceptions in PLI?

There's even more to it than that. If procedure A establishes an ON-unit (via the ON-statement) and then calls procedure B, procedure B can execute an ON-statement establishing a new ON-unit for the same condition (exception, sort of). B's ON-unit remains in effect until overridden, REVERTed (see below), or until B returns to A. When B returns to A, B's ON-unit is cancelled(implicitly REVERTed) and A's ON-unit restored as the active ON-unit for that condition. In addition, the REVERT statement explicitly reverts an ON-unit established in the current scope to the ON-unit or default condition handler in effect before execution of the ON-statement for that condition in the current scope. Some conditions are pre-defined (as mentioned previously by rexxhead), e.g., ENDFILE(<file>), ENDPAGE(<file>) (particularly useful for printing page headers and footers), ERROR, OVERFLOW, SUBSCRIPTRANGE, etc.; the others are user-defined. The pre-defined conditions are frequently detected and signaled ("thrown" in C++ terminology) automatically by PL/I (or its run-time library), by the operating system, or even by the hardware (well, O/S and H/W exceptions and interrupts are intercepted by the PL/I run-time library and converted into conditions). User-defined conditions are signaled by the SIGNAL statement (which can also signal pre-defined conditions -- usually to test condition-handlers for pre-defined conditions). There are some additional subtleties and some pretty fancy capabilities in full PL/I (e.g., change the input source buffer for a field in a formatted read that failed and then resume execution re-reading that field and then proceding -- though I've never used this or seen it used), but that covers most of the common uses.

Difference between verify and index?

VERIFY Indicates the position in string x of the first character thats not in string y. if all r there it returns 0 example: VERIFY(SAM,SAM)returns 0 VERIFY(ABCD,EREE) returns 1 INDEX Returns the starting position of the string y within x; returns 0 if y is not there in x example: index(sam,agt) returns 2 index(sam,dog) returns 0
2.Difference between verify and index? Both return positions of data not existing in second variable Diff is in o/p. verify returns first char of x not in y. Index returns number of positions of y in x 3.what is control keyword in pli? Controlled is one of the storage classes. It can be used to allocate variable memory as and when it is used. 4.what are the the different types of string functions in pli? Strcp,strcmp,substr,translate,verify 5.how do you write from pli code to jcl?

6.what is the entry statement ?where we use; Entry structure/variables/procedures are defined in predefined libraries, these can be used in our app pgm by coding ENTRY stmt 7.where we use BASED? what is the purpose; based var is used for ADDressing memeory of the variable/structure. This is one of the types in pl1 to redefine the memory area. 8.default variable declaration? automatic write syntax to declare dynamic array? DCL abc(*) char(4); what is the scope of the variable if it is inside the procedure? Fixed what is subroutine? X n y are two pgms; x calls y; y executes and control passed back to x; what is subroutine? X n y are two pgms; x calls y; y executes and control passed back to x; how to include copybook? By using the %INCLUDE stmt 17.what is the different types of storage class? Auto/based/controlled/static 18.which proc execute when compile a pli program? Main 19.how do know it is pli? *PROCESS/Block structure 20.in options (main) , what is meaning of main . if u not used main what will happen? After compiling, os will not understand where to load and execute from 21.difference between steam i/o and record i/o? which one u will prefer and why? Stream i/o is for small amounts of data i.e., for getting info from sysin or so..; i/p data is not converted to upper case in stream i/o Record i/o: for larger data intake into app pgm/write to file in jcl. 22.In ON ERROR statement how to allow the system action? On error system
Back to top

1.how do you handle exceptions in PLI? 2.Difference between verify and index? 3.what is control keyword in pli? 4.what are the the different types of string functions in pli? 5.how do you write from pli code to jcl? 6.what is the entry statement ?where we use 7.where we use BASED? what is the purpose 8.default variable declaration? 9.what is the use to declare variable as external? 10.write syntax to declare dynamic array? 11.what is the scope of the variable if it is inside the procedure? 12.how to find a program as a static or dynamic? 13.what is subroutine? 14.what is fetchable?why we use fetchable 15.difference between call by name and call by reference? 16.how to include copybook? 17.what is the different types of storage class? 18.which proc execute when compile a pli program? 19.how do know it is pli? 20.in options (main) , what is meaning of main . if u not used main what will happen? 21.difference between steam i/o and record i/o? which one u will prefer and why? 22.In ON ERROR statement how to allow the system action? 23.what are the error(oncodes)did you encounter pli program? 24.how do you pass pointer pli main procedure to subporgram? 25.how to handle oncode 8097 ?
Back to top

5. how do you write from pli code to jcl?


http://mainframe230.blogspot.in/2010/11/pli-sample-programs-3.html To insert multiple rows using DB2:
EXEC SQL INSERT INTO DSN8810.ACT (ACTNO, ACTKWD, ACTDESC) VALUES (:HVA1, :HVA2, :HVA3) FOR :NUM-ROWS ROWS END-EXEC.

You might also like