Logical Error

mustish1
mustish1 used Ask the Experts™
on
When I enter new customer number it wont go to the next screen, Can any one please help me out?

Thanks
screenshot.png
code.txt
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave FordSoftware Developer / Database Administrator

Commented:
The "RECORD IS NOT ON FILE" error you see occurs when the CHAIN on line 57 didn't find a matching record, right? Is that indicator in  the right position?

Author

Commented:
What change i do here?

0057.00 C     KEYLIST       CHAIN     CUST                               91             140916                                      
0058.00 C                   IF        *IN91=*ON                                         140917                                      
0059.00 C                   EVAL      ERRLIN=ERR2                                       140917                                      
0060.00 C                   EVAL      *IN90=*ON                                         140917                                      
 Columns . . . :    6  80                                       Edit                                                USER224/QRPGSRC
0060.01 C                   ELSE                                                        140924                                      
0060.02 C                   EXSR      ADDSCREEN                                         140924                                      
0060.03 C                   ENDIF                                                       140924                                      
0065.00 C                   ENDSR                                                       140917

Author

Commented:
Also why I have to use indicator 90, 91, 92 and 93. Can I choose any number?

Thanks
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Dave FordSoftware Developer / Database Administrator

Commented:
You can use any indicator-number you want (so long as it's not used elsewhere in the program for some other purpose.

It's seriously been over a decade since I coded like that, so I don't remember which positions the indicator needs to be in. You'll have to read the manual for that.

The best option I can see for you is to fully move into this century and code it in free-form and eliminate the use of indicators altogether.

e.g.
/free
  chain fileKey MyTable;
  if %found;                
    do something;
  else;
    do something else;
  endif;
/end-free

Open in new window


HTH,
DaveSlash

Author

Commented:
ok. it looks like easy to work. Can you please tell me do i just type /free at any column or I have to type at any special column? Also just type my code between free and end-free or is there any thing else it needs? Also can i use embeed SQL between free and end-free too

Thanks
Software Developer / Database Administrator
Commented:
I believe the /free and /end-free has to start in position 7. Beyond that, you just type your code in ... with a semi-colon (;) at the end of each line.

Free-format embedded SQL is supported in later OS versions, so that'll depend on which OS level you're at.

HTH,
DaveSlash

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial