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

What is mainframe application testing?

0 Answers  


Hi all, I have >200 members per Dataset, I need to delete 2 lines from all members of a Dataset. To do Manually it is difficult. So please tell me simple method. is there any Tool or........

2 Answers  


what is u r recent task in insurence project?..plz tell how to tell this.

0 Answers   Syntel,


What is the importance of common attribute?

0 Answers  


Why is free space left in ksds dataset?

0 Answers  






How is data retrieved from multiple tables using a single sql statement?

0 Answers  


Differentiate between hdam and the hidam databases?

0 Answers  


Why are you looking for a change?

0 Answers  


what is the difference between the jes2 and jes3

2 Answers  


Can you explain function of dbctl?

0 Answers  


Write about a ‘view’ in brief?

0 Answers  


What is meant by deadlock in db2?

0 Answers  


Categories