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 ARE THE RETRIVAL ORDER OF FILES IN RPG&sql?

1 Answers  


Define clustered index?

0 Answers  


HOW to change the coloumns in XREF?

0 Answers  


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

0 Answers   AppLabs,


How do you create a like table?

0 Answers  






How do you handle exceptions PL/1?

1 Answers   IBM,


What is the need of running runstats in the test environment?

0 Answers  


difference between   wrkobj &  dspobjd?

1 Answers  


Explain ibm z?

0 Answers  


What is basic difference between directory and pds in ibm mainframe?

0 Answers   IBM,


what is the other verb for release and write ?

0 Answers   IBM,


How do you find whether any generations exist under a gdg base?

0 Answers  


Categories