IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need information on creating dynamic Input in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
grvdeshmukh0

New User


Joined: 16 Jan 2020
Posts: 3
Location: Pune

PostPosted: Thu Jan 16, 2020 1:55 pm
Reply with quote

Hi,

Currently, I am working on a REXX automation and facing difficulty while generating dynamic panel based on user’s input
I want to take the number of columns as an input from the user and then based on that, panel should generate that many input fields for the user to enter column names. Can anyone please suggest how can I achieve this
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Jan 16, 2020 3:16 pm
Reply with quote

What is the difficulty? What have you achieved so far?
Back to top
View user's profile Send private message
grvdeshmukh0

New User


Joined: 16 Jan 2020
Posts: 3
Location: Pune

PostPosted: Thu Jan 16, 2020 3:35 pm
Reply with quote

Hi .. I have been able to create static panels wherein a user can give fix number of inputs. But my requirement is a bit different. Please refer the below example.

Please Enter no of Columns: (To be entered by user)

Then the panel should display that many input fields for the column names so that user can enter further inputs
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Jan 16, 2020 4:43 pm
Reply with quote

You cannot change the layout of the currently displayed panel whilst it is being displayed. Get the information from the user then create a new panel with the requisite number of fields and display that.
Back to top
View user's profile Send private message
grvdeshmukh0

New User


Joined: 16 Jan 2020
Posts: 3
Location: Pune

PostPosted: Thu Jan 16, 2020 5:42 pm
Reply with quote

Thanks for the input. Do you have any example or link which I can refer to?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Jan 16, 2020 5:47 pm
Reply with quote

You could try this.

Create your panel with the maximum number of possible columns.
For my example lets say Nine.

Then in your INIT section, change the attributes for columns higher than the requested amount.

See an example here. Modify this for your needs.

Code:
)INIT
 IF (&COLREQ < 9)
   .ATTR(COL9) = ' TYPE(OUTPUT) INTENS(NON)'
 IF (&COLREQ < 8)
   .ATTR(COL8) = ' TYPE(OUTPUT) INTENS(NON)'
 IF (&COLREQ < 7)
   .ATTR(COL7) = ' TYPE(OUTPUT) INTENS(NON)'
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Jan 16, 2020 6:26 pm
Reply with quote

Use an ISPF table:
- Define a panel with a fixed part (Enter no of Columns:) and a )MODEL part.
- Define an ISPF table with fields: seq.no, column name and other info you need.
- Display (or TBDISPL) the panel and empty table.
- Once the user enters the no of Columns, create dummy entries in the table (with only seq. no)
- TBDISPL the panel and let the user fill the empty lines with column names and so on.

Another option would be to have a panel with a fixed part (column name and other info) and a )MODEL part.
Each time the user fills the fixed part and hits ENTER, a row is added to the ISPF table and displayed in the )MODEL part, and the fixed part is cleared.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Thu Jan 16, 2020 9:07 pm
Reply with quote

Use REXX to generate the panel, write it to a temporary dataset and do a LIBDEF ISPPLIB to that dataset.
Alternatively build the panel in a REXX stem and use the ISPF panel exit ISPDPX01 found at harders-jensen.com/wjtech/zprograms.html to show the panel dynamically.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Jan 17, 2020 2:17 am
Reply with quote

The problem description is still not clear to me. Are you automating the creation of a DB2 table? If so, I recommend using the 'create' panels of IBM's DB2 Administration Tool. It already solves the problems you are likely to encounter. Many DB2 customers also have the DB2 Admin Tool.

If not DB2, then I agree with Marso's suggestion of using an ISPF table to get column information from the user. Though, my suggestion is for the table display to support line commands to repeat/delete/insert column information.
Back to top
View user's profile Send private message
Imabeliever

New User


Joined: 15 Aug 2019
Posts: 4
Location: Australia

PostPosted: Fri May 01, 2020 9:03 am
Reply with quote

You can create a dynamic area on a panel and put however many fields you like there (up to whatever documented limits there are).

You control the field contents programmatically.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri May 01, 2020 6:21 pm
Reply with quote

Imabeliever wrote:
You can create a dynamic area on a panel and put however many fields you like there (up to whatever documented limits there are).

You control the field contents programmatically.

That's exactly what SDSF is doing.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Sat May 02, 2020 12:23 am
Reply with quote

Quote:
You can create a dynamic area on a panel

I did that on a project when I worked for IBM. It was somewhat difficult, especially when you have to scroll. Also, you have to parse out any input fields that you create and verify them yourself.

When someone asked me for advice, I gave them this idea which they implemented:

1. ask the user for how many fields
2. allocate a PDS
3. from your program, create the panel in the new PDS. I assume the top has fixed area and the 'field' lines are repetitive (done in a loop)
4. LIBDEF ISPPLIB to the PDS
5. use DISPLAY service to show the panel.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top