How do you pass pointer PL/1 main procedure to sub
procedure?



How do you pass pointer PL/1 main procedure to sub procedure?..

Answer / mithun kilikdar

If we need to pass variables from one procedure to another
procedure or from one pgm to another pgm then we can
directlt pass the variables. Or one more way is to pass
poiters. Below is the example:

PROGRAM_A: OPTIONS(MAIN) REENTRANT:

DCL FORE_NAME CHAR(20) INIT('');
DCL SUR_NAME CHAR(20) INIT('');
DCL PTR1, PTR2 POINTER;
:
:
PTR1 = ADDRESS(FORE_NAME);
PTR2 = ADDRESS(SUR_NAME);
CALL PROGRAMB_( PTR1
, PTR2
);
:
:
END; /*PROGRAM_A*/



PROGRAM_B: OPTIONS(P_PTR1
,
P_PTR2
);

/*DECLARATION*/
DCL PTR1, PTR2 POINTER;

/*INTERNALIZATION*/
PTR1 = P_PTR1;
PTR2 = P_PTR2;
:
:
/* USE PTR1 AND PTR2 TO USE FORE_NAME AND SUR_NAME
END; /*PROGRAM_B*/

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More IBM MainFrame AllOther Interview Questions

Write about the self-referencing constraint?

0 Answers  


What do you mean by linkage section?

0 Answers  


what are the ARRAY operations in    rpg/400?

1 Answers  


stmts affected by activation group?

1 Answers  


Can the values of alphanumeric be moved to variable numeric?

0 Answers  






If a ceo wants to see all employees of the company from an online screen. How will be the design of the map from the developer point of view?

0 Answers  


Can I redefine an x(200) field with a field of x(100) ?

0 Answers  


How do you create a like table?

0 Answers  


Explain foreign keys?

0 Answers  


how do u conduct impact analysis?

0 Answers   Tech Mahindra,


How scary is it to write code for a bank?

0 Answers  


GO TO stmt which of the following is not true A) GO TO stmt is not essential in the sense that it is possible to write programs without using GO TO B) The target of the GO TO stmt being a procedure name avoiding GO TO result in a program with no procedure name C) Indiscriminate use of GO TO stmt can make the control structure program substantially complex D) Too many GO TO stmts make a program difficult to understand

2 Answers   Accenture, IBM,


Categories