KB Article 10255
2013/08/09

Close
X
Contact Tech Support

 Email Tech Support
 (250) 655-1766
 [7:30 - 5:00 PST]
Your Meeting ID will be Provided by a Rep.
Tech Support
Tech Support Home
Software Updates
Knowledge Base Search
Recent KB Articles
Product FAQs
Code Samples
Documentation
Tech Blog
System Requirements
Installation Instructions
Support Testimonials
Contact us to...
Create a Ticket
Request a Free Demo
Suggest a New Feature
Submit Feedback
Upload a Large File
Other Services
Software Training
Professional Services

CPF5218 error when calling a subfile program where there are zero records loaded (and PDM cursor compliance is also set on).

Product: ProGen Plus Type: Troubleshooting

Problem:
You call a Style E program with a blank subfile and PDM cursor compliance is set to ON. The program tries to position the cursor on a non existent field within the subfile and this error occurs:
 
Session or device error --- >
Error CPF5218 - "Incorrect record number in subfile SFLRCDNBR or SFLSIZ" occurs when calling a program that tries to load a subfile with no records.
 
Workaround:
This problem had been identified and resolved in other templates, but in Style E it came back. Here is how you can work around this.
 
1. Change the shell to add the proper condition. This is the best solution and the one that will be implemented when the fix for this issue is ready. To change the shell do the following:

- For ILERPG programs -
  • Type ZWRKSS
  • Change the file to GN#FLES
  • Position to GN#PGN, then take an option 2 to change it
  • Find the subroutine $KEYPM
  • Locate the line: C IF @@SFLCRS > @@SFLRCNT
  • Insert a line and add the condition: C AND @@SFLRCNT < > 0

- For RPG400 programs -

  • Type ZWRKSS
  • Change the file to GN#FSRC
  • Position to GN#PGN, then take an option 2 to change it
  • Find the subroutine $KEYPM
  • Locate the line: C SCRS## IFGT SLIM##
  • Insert a line and add the condition: C SLIM## ANDNE*ZERO

2. The other alternative is to modify the generated source code at $KEYPM to include a second condition that will check if the subfile record count is not equal to zero, as follows:

** For ILERPG **
IF @@SFLCRS > @@SFLRCNT
AND @@SFLRCNT <> 0 
EVAL @@SFLCRS = @@SFLRCNT
ENDIF

** For RPG400 **
SCRS## IFGT SLIM## 
SLIM## ANDNE*ZERO 
Z-ADDSLIM## SCRS## 
ENDIF
 
Notes: 
This was replicated at version 9.6 and 9.7 for Style E programs. The change has been added to the shells for the style E, so the next time the shells are shipped should fix the problem.

Rate This Article

Did this example help you to achieve your goal?
 Yes  No  Don't Know

Enter additional comments below.   If you want to hear back from us, include your contact information.

Email Address:
Comments:
Please enable JavaScript in order to rate this page.