Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need information on creating dynamic Input in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Need information on creating dynamic Input in REXX
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: 2365
Location: Hampshire, UK

PostPosted: Thu Jan 16, 2020 3:16 pm    Post subject: Reply to: Need information on creating dynamic Input in REXX
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    Post subject: Reply to: Need information on creating dynamic Input in REXX
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: 2365
Location: Hampshire, UK

PostPosted: Thu Jan 16, 2020 4:43 pm    Post subject: Reply to: Need information on creating dynamic Input in REXX
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    Post subject:
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: 739
Location: Pennsylvania

PostPosted: Thu Jan 16, 2020 5:47 pm    Post subject:
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: 1349
Location: Israel

PostPosted: Thu Jan 16, 2020 6:26 pm    Post subject: Reply to: Need information on creating dynamic Input in REXX
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 User


Joined: 01 Sep 2015
Posts: 362
Location: Denmark

PostPosted: Thu Jan 16, 2020 9:07 pm    Post subject:
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 http://harders-jensen.com/wjtech/zprograms.html to show the panel dynamically.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Fri Jan 17, 2020 2:17 am    Post subject: Reply to: Need information on creating dynamic Input in REXX
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: 3
Location: Australia

PostPosted: Fri May 01, 2020 9:03 am    Post subject: Reply to: Need information on creating dynamic Input in REXX
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: 1206
Location: Vilnius, Lithuania

PostPosted: Fri May 01, 2020 6:21 pm    Post subject: Re: Reply to: Need information on creating dynamic Input in REXX
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

Senior Member


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

PostPosted: Sat May 02, 2020 12:23 am    Post subject: Reply to: Need information on creating dynamic Input in REXX
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IOF reading using REXX paval21 CLIST & REXX 0 Mon Jun 15, 2020 9:44 pm
No new posts Need to open a DSN using REXX & e... Y Marwaha CLIST & REXX 10 Fri Jun 05, 2020 7:30 pm
No new posts Execute Partially Edited Rexx Exec fr... AllenSieracki CLIST & REXX 14 Tue Jun 02, 2020 7:56 pm
No new posts Compare multiple files using JCL/Rexx... tanvi110788 JCL & VSAM 4 Tue May 19, 2020 5:47 pm
No new posts In JCL Procedure how we can execute R... Dhananjayulu Neeli CLIST & REXX 7 Sat May 16, 2020 12:01 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us