Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with screen..

Status
Not open for further replies.

snowtiger

Programmer
Oct 10, 2002
3
US

I have a screen created thru SDA on an AS/400.

The input field is a single digit numeric field with no
signs. I'll call it LOADNUM.

There is an output field that I use to display
messages based on what day you chose. It's 44 characters
long and I call it LOADMSG.

1 being Sunday, 2 = monday, etc etc.

If you chose say a 3 for tuesday. It will go through
the program and look for tuesday only info.

Here's the problem. When I say ...

MOVE "SUNDAY LOAD SCHEDULE SUCCESSFULLY PRINTED"
TO LOADMSG

LOADNUM's value will change from 3 to 5.

Does anyone out there have any idea, what might be
causing this???

sorry, I'm new here.

If you'd like I can try and post the screen and the
program... if anyone is interested.
 
When you do a WRITE record FROM format FORMAT IS "whatever", it displays all the output fields, so your message AND the value of the output field of LOADNUM, right? So it oculd be that the input field of LOADNUM is no longer the same as the LOADNUM in the output format. Try adding this before you do the WRITE:

MOVE LOADNUM IN (inputformat) TO LOADNUM IN (outputformat)

That could do the trick... --------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 


Here's the layout of the file IN A COMPILED FORMAT...

FD LOADDAY
LABEL RECORDS ARE OMITTED.
01 LOADDAYREC.
COPY DDS-ALL-FORMATS OF LOADDAY.
05 LOADDAY-RECORD PIC X(44).
* INPUT FORMAT: LOADDDAY1 FROM FILE LOADDAY OF LIBRARY STEVE
05 LOADDAY1-I REDEFINES LOADDAY-RECORD.
06 LOADDAY1-I-INDIC.
07 IN03 PIC 1 INDIC 03.
07 IN12 PIC 1 INDIC 12.
06 LOADNUM PIC S9(1).

* OUTPUT FORMAT: LOADDAY1 FROM FILE LOADDAY OF LIBRARY STEVE
05 LOADDAY1-O REDEFINES LOADDAY-RECORD.
06 LOADMSG PIC X(44).


Now in the procedure division...I have this..

001-GET-DAY.
WRITE LOADDAYREC FORMAT IS "LOADDAY1".
READ LOADDAY RECORD.
......
MORE CODE...
......
001-EXIT.

Okay so now I enter in a number and the number is there
IN loadnum.

but when I hit this code the value changes....

IF LOADNUM = 3
MOVE "TUESDAY LOAD SCHEDULE SUCCESSFULLY PRINTED"
TO LOADMSG
MOVE DVDLDP3 TO DETLOAD <- (INSIGNIFICANT)
GO TO 005-EXIT.

I ran this in debug mode (STRISDB) and loadnum's value
changed immediately after the move to loadmsg.

Anyone have suggesstions???
 
Note that LOADMSG is part of LOADDAY1-O which REDEFINES LOADDAY-RECORD. So, byte 3 of LOADMSG is the same as LOADNUM. The &quot;E&quot; in TUESDAY is x'C5' or a signed +5!!

Move LOADNUM to a working area BEFORE changing LOADMSG.

Glenn
 

Thanks...

It's been 6 years since I've written any interactive
cobol on the AS/400. so I'm kind of relearning this.

so a question to you .. 3gm.

Is there another valid way of doing this..

such as creating a 2nd record by copying the first
in Screen Design Aid and then say delete loadnum in
the 2nd screen and just keep loadmsg

and use the write statement for say &quot;SCREEN1&quot; for input
and &quot;SCREEN2&quot; for output???
 
Well, I've never done any AS/400 development, so I can't really help you. Your proposed approach sounds like it should work. You can probably try it out without much trouble or wait for someone else in the forum who has done this sort of thing to respond.

Good luck!

Glenn
 
I know that some elements of design can be considered as a matter of personal preference or taste, but...

Should you overlay the screen user's input w/a msg? Would it be preferable to keep the orig i/p on the screen and display your msg beside or under the i/p data? After all, he may have mistakenly entered &quot;3&quot; when he wanted to enter &quot;2&quot; and is expecting the &quot;Monday&quot; msg. The &quot;3&quot; remaining on the screen will aid him in resolving his dilemma.

In addition to allowing the user to verify the msg against the i/p, it solves the overlay problem you have.

Regards, Jack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top