Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adjustable size of subfile field.

166 views
Skip to first unread message

Donald W. Zimmerman

unread,
Dec 19, 1996, 3:00:00 AM12/19/96
to

I'm trying to create a display file which has a subfile where I
have a 70 character input capable field that I want to control
the size that is displayed and enterable. I was able to only
display the portion of the line I wanted by putting hex code 20
at the spot where I wanted the field to quit being
displayed, but am unable to keep someone from entering
information on the line past the portion physically displayed. If
you've used anytype of database file utility, that allows you to
change data in any field from any file, this is similar to what
I'm trying to accomplish. Any help would be appreciated.

--
Donald W. Zimmerman

Pete & April Whitstone

unread,
Dec 19, 1996, 3:00:00 AM12/19/96
to

Hi Donald,

There are a couple ways to go about this. UIM (panel groups) handle
wariable length fields, and can handle subfile-like displays, but the
coding is nothing like subfile coding. For instance, to get "records",
referred to as "list entries" into the "subfile", referred to as a
"list", you use API's to "write" the data into the display. Then a
different API is used to actually perform the EXFMT statement. I'm doing
this from memory so if some of the details are incorrect I apologize.
There are several good books available on coding UIM panels.

Another, more primitive way to go about it would be to define and
condition fields of various lengths into your subfile. If you needed
fields of any size between 1 and 70 characters, this would require 70
fields conditioned by 70 indicators. I'm not sure what the I/O impact
would be, but I have a feeling it might not be very efficient. Also,
having conditioned fields in a subfile requires that SFLPAG equals
SFLSIZ. I'm not sure what type of application you are coding, but if you
needed the user to be able to key 3 pages worth of stuff before the
changes were written to the database, you would need a temporary storage
area, like a work file or perhaps writes to the file under commitment
control and then rollbacks or commits at the appropriate points. Anyhow,
after you read in one of these subfile records, you would have to
determine which of the 70 fields to get the data out of, which also
wouldn't be very efficient.

I don't know of a way to "turn off" the input-capability of a field thru
the DSPATR hex codes.

Hope this helps,
Pete Whitstone
Weasel Software

The Image Trader

unread,
Dec 21, 1996, 3:00:00 AM12/21/96
to

Donald W. Zimmerman wrote:
>
> I'm trying to create a display file which has a subfile where I
> have a 70 character input capable field that I want to control
> the size that is displayed and enterable. I was able to only
> display the portion of the line I wanted by putting hex code 20
> at the spot where I wanted the field to quit being
> displayed, but am unable to keep someone from entering
> information on the line past the portion physically displayed. If
> you've used anytype of database file utility, that allows you to
> change data in any field from any file, this is similar to what
> I'm trying to accomplish. Any help would be appreciated.
>
> --
> Donald W. Zimmerman

Donald W. Zimmerman <10413...@CompuServe.COM>? As far as I know,
there is no way of controling user keystrokes on a 5250 type terminal.
Ya gotta realize that a 5250 workstation ain't a PC.

When I wrote a program (in COBOL/400) that used a generalize record
format to collect variable data elements, I placed field labels on the
left side, and fields on the right, and used the DSPATR function to
hide & protect or unhide & enable fields as needed. Then, if, for
example, I wanted to limit the size of the input to five bytes, in a ten
byte field, I prefilled the field with ten spaces, and placed an 'X' in
the sixth position, before writing the format (EXFMT, for you RPG
types). When I read the format back in, I'd use reference modification
to make sure that positions 6 thru 10 contained the value 'X____', where
'_' is a space. If this wasn't true, I'd redisplay the format, with a
message telling the user that the value input is invalid. The same
technique can be utilized with subfiles, except you'd have to put the
field labels next to each other in a heading line. If each field (or, in
the case of subfiles, column) label was a field, you'd be able to change
the text in your program to reflect what size data you expected.

0 new messages