Page 1 of 1

What JCL to run a PL / I menu?

PostPosted: Sat Mar 14, 2015 11:17 pm
by michel123
Hello, on the internet I found the following code to display a menu and answer (Options 1, 2, 3 or 4):

/ * PROGRAM MENU TO CALL DIFF. PROGRAMS * /
MENUPROGRAM: PROC OPTIONS (MAIN);
DCL RDPROGRAM EXT ENTRY;
DCL WRPROGRAM EXT ENTRY;
DCL MODPROGRAM EXT ENTRY;
DCL CH CHAR (1);
PUT SKIP LIST ('MENU');
PUT SKIP LIST ('1. ADD TO RECORD A');
PUT SKIP LIST ('2. TO READ A RECORD');
PUT SKIP LIST ('3. TO MODIFY RECORD A');
PUT SKIP LIST ('4. EXIT');
PUT SKIP (2) LIST ('ENTER YOUR CHOICE (1-4):');
GET LIST (CH);
IF CH = '1' THEN
CALL WRPROGRAM;
ELSE
IF CH = '2' THEN
CALL RDPROGRAM;
ELSE
IF CH = '3' THEN
CALL MODPROGRAM;
ELSE
IF CH = '4' THEN
RETURN;
ELSE
PUT LIST ('WRONG CHOICE');
END MENUPROGRAM;

How to write the associated JCL?

Thank you.

Re: What JCL to run a PL / I menu?

PostPosted: Sun Mar 15, 2015 1:13 am
by enrico-sorichetti
unfortunately Your program is designed for a batch environment so
You will have to forget about the MENU thingy
PUT LIST will write to the ddname SYSPRINT
and the GET LIST will read from the ddname SYSIN
most probably, because of buffering You will not see the menu

so not much ( NO ) interactivity :mrgreen:

everything will be done reading and writing to traditional ddnames

You will have to provide in the SYSIN DD the option chosen

Re: What JCL to run a PL / I menu?

PostPosted: Sun Mar 15, 2015 2:10 am
by michel123
Hello and thank you for your long and precise answer.

I will resign myself to put everything in the SYSIN with my choice.

best regards.

Re: What JCL to run a PL / I menu?

PostPosted: Sun Mar 15, 2015 5:27 am
by prino
michel123 wrote:Hello and thank you for your long and precise answer.

I will resign myself to put everything in the SYSIN with my choice.

Michel,

Contact me, assuming you're the same, privately on that other forum, I've got a PL/I program that actually interfaces ISPF, the program won't run any more (it needs DB2), but it should give you some clues as how to make PL/I and ISPF work together.

Robert

Re: What JCL to run a PL / I menu?

PostPosted: Sun Mar 15, 2015 9:45 pm
by michel123
Hello Robert,

I answered in your private box.