Link to home
Start Free TrialLog in
Avatar of a016691
a016691

asked on

Legacy COBOL Application / keyboard mapping problem

I am new on the AS/400 and COBOL. I have a 20 year old application and need to know how to determine which keyboard keys the program is using in the program.

The actual COBOL code has very few statements that relate to a key-hit as below.

IF KEY-HIT = 3 OR 8
    GO TO 999-END-PROG.

Where are the keys defined? We have changed from IBM terminals to Windows PC's and the program is not working the same on the pc.
Avatar of Member_2_2484401
Member_2_2484401
Flag of United States of America image


Most likely, when the program tests for "KEY-HIT = 3 OR 8", that corresponds to the F3 and F8 keys on your PC keyboard.

You can map your keys within your green-screen session by clicking Edit, then Preferences, then Keyboard.  But, you might not need to do it if you can use the F-keys.

HTH,
DaveSlash
Avatar of a016691
a016691

ASKER

Yes, I assume that the statement Key-Hit = 3 means when I press F3.
The problem is that no where in the source code does it say anything about any other keys..
I need to know how the other keys are programmed so I can change when it expects a field-exit for example into a simple enter key.
DaveSlash is probably right that the values correspond to the various <F-keys>. As for answering how the correspondence is coded, that will require seeing more code. We can't see how KEY-HIT is defined nor can we see how values are set in KEY-HIT.

Without those, it's anybody's guess.

Please show any COPY statement(s) that brings the display file description into the program. There might be an indicator area that maps <F-keys> to values. If not, the format of the COPY statement(s) should provide other clues, about what to ask next if nothing else.

Tom
ASKER CERTIFIED SOLUTION
Avatar of daveslater
daveslater
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Though the keys are defined in the DDS (assuming that DDS was used, which is almost certain), that doesn't necessarily result in a numeric value of 3 or 8 in a field in the COBOL program (though that's almost certain too).

For 99+%, Dave is probably right. But be aware that if a problem with handling <F-keys> is being investigated in COBOL, there can be elements of the program that are making differences.

Tom
Avatar of a016691

ASKER

Dave was correct the display file is what I needed.

Thanks
a016691:

I hope Dave (and DaveSlash too) knows by now that I wouldn't make a negative comment on his posts as a contradiction. Just to clarify, if someone looks through this thread, say, a year from now, I hope that any extra info might be useful to that individual. I'm happy adding value to a thread even if points have long since gone by.

So, when I can add light to a wider view of a question, I often tack bits on the end. Just in case...

Glad it's all working.

Tom