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

Expand ISPF field up to a limit - is it possible?


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Cris_70

New User


Joined: 09 Feb 2021
Posts: 8
Location: Italy

PostPosted: Fri Jun 03, 2022 5:14 pm
Reply with quote

Hi all,
I am adapting some panels of mine so that they adapt to screens wider than 80 columns.
In one particular panel I have input fields that should not exeed 64 chars.

With the standard 80x24 screen I am able to show input fields of about 55 chars (due to the presence of other elements on the same row), so I initially made those fields scrollable, so that the user can insert up to 64 chars.

Now I'd like to be able to make use of the (eventual) additional screen width by making them expand, but when I try to do so they obviosuly expand to the full length of the available screen, and that usually means they get much more long than 64 (e.g. with screens that are 132 or 160 columns wide).

Is there a way to tell ISPF to expand those fields but do not allow them to grow more than 64 columns wide?

Before you ask: I do check the length of the value that the user inputs, but this is checked only after the user presses ENTER. At that point, the user gets an error because the value is too long, but I'd prefer if the input field would be exactly as long as the value can be, so that the user does not have to proceed by guessing.

I hope I explained it well enough to make it understandable :-)

Thank you in advance
Cris
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Fri Jun 03, 2022 7:41 pm
Reply with quote

The only solution I can think of off hand is to have 2 panels, one for less than 90 wide and one for 90+ wide. You can use the WIDTH parameter of the )BODY statement to limit the width of the panel.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Fri Jun 03, 2022 10:03 pm
Reply with quote

Actually, you can, by using the )FIELD panel statement.
Sample:
)Field
field(f1 ) scroll(on) len(84)
Back to top
View user's profile Send private message
hankoerlemans

New User


Joined: 25 Jan 2018
Posts: 57
Location: Australia

PostPosted: Tue Jun 07, 2022 8:56 am
Reply with quote

Typically you use PQUERY to get the current screen limits and format the panel accordingly.
Fault Analyzer panel IDIPDIRL shows the panel construction required.
SDSF panel ISFPCU41 shows similar complexity.

I suppose it depends on how flexible you want to be.
Back to top
View user's profile Send private message
Cris_70

New User


Joined: 09 Feb 2021
Posts: 8
Location: Italy

PostPosted: Tue Jun 07, 2022 4:58 pm
Reply with quote

Hi Willy

Willy Jensen wrote:
Actually, you can, by using the )FIELD panel statement.
Sample:
)Field
field(f1 ) scroll(on) len(84)


Thank you for your help Willy.
Unfortunately, that's not what I see.
Despite having a "FIELD(crtou) LEN(64) SCROLL(ON) IND(I2)" instruction in the )FIELD section, I see the "crtou" field expanding to 133 columns (all the space it has available in a 160 columns screen).
Back to top
View user's profile Send private message
Cris_70

New User


Joined: 09 Feb 2021
Posts: 8
Location: Italy

PostPosted: Tue Jun 07, 2022 5:02 pm
Reply with quote

hankoerlemans wrote:
Typically you use PQUERY to get the current screen limits and format the panel accordingly.
Fault Analyzer panel IDIPDIRL shows the panel construction required.
SDSF panel ISFPCU41 shows similar complexity.

I suppose it depends on how flexible you want to be.


Thank you hankoerlemans for your suggestion.
I know that type of construction, having used it in the main panel of the same program.
This one is just a secondary panel and I do not want to manage all that complexity.
I think I'll just settle with what I have i.e. a field that does not expand and remains limited to 55 columns even when the screen allows for more columns.

Thank you!
Cris
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Jun 08, 2022 9:25 am
Reply with quote

Various thoughts:

1. You can use variable ZSCREENW ahead of time to check the width of the screen.

2. PQUERY is used for a dynamic area. You did not say that you were using a dynamic area. It might be feasible to change one or two single fields from a standard entry field to be a dynamic area.

3.
Quote:
this is checked only after the user presses ENTER


On such occasions, I have used something like this ahead of time:
Code:
CONTROL NONDISPL ENTER
DISPLAY PANEL(xyz)

so that I can check stuff and make adjustments for when the panel is actually presented to the user.

4. You might be able to limit the length of your field by adding an empty dummy field to the right. Use the )FIELD definition as Willy suggest, but use a variable name in the length field.
Back to top
View user's profile Send private message
Cris_70

New User


Joined: 09 Feb 2021
Posts: 8
Location: Italy

PostPosted: Wed Jun 08, 2022 11:54 pm
Reply with quote

Hi Pedro!

Thank you for your ideas!

I tried out number 4, which I liked very much! Unfortunately it does not work as ISPF does not dimension the field based on the length declared in the )FIELD section; instead, it dimensions the field solely based on the number of characters assigned to it in the )BODY section.

I am going to try out suggestion number 3, I'll get back to you.

Cris
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Thu Jun 09, 2022 12:12 am
Reply with quote

The only solution I can think of then is an ISPF panel exit. I have one ISPDPX01, which is an ISPF panel exit to insert records into an ISPF panel. It can replace the entire panel or one or more sections with data in REXX stem variables. It is found here: harders-jensen.com
I also seem to remember an IBM exit to add conditional sections to a panel, but I can't remember what it is called or where it is found. I could not find it in neither ISPF nor system SAMPLIB.
But installing an exit is a bit extreme for this case.
Back to top
View user's profile Send private message
Cris_70

New User


Joined: 09 Feb 2021
Posts: 8
Location: Italy

PostPosted: Thu Jun 09, 2022 12:38 pm
Reply with quote

Hi Willy.
You made me think of something I used in the past: it's the "deimbed" function from Frank Clarke (see www.rexxla.org/freerepo/REXX/).

I ended up using it and it works quite nicely, with the added benefit that now all my panels are self-contained in the rexx source.

I had to modify it a little, to allow on-the-fly changes to the source of the panels when they are retrieved from source and before they're written to the temporary library.

So now, when the program is started, it retrieves width and depth of the terminal screen and then changes the panel(s) accordingly.

Thank you!
Cris
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Join 2 files according to one key field. JCL & VSAM 3
Search our Forums:

Back to Top