Answer Posted / katiyar
As I mentioned above RRN (Relative Record Number) may be a
cause of "Session and Device Error". So In program code, at
display(EXFMT) subfile code, check the value of RRN. If is
is zero and you are making on the SFLDSP indicator *On or it
is un-conditional and doing display subfile. Then it will
give you the same error.So to avoid this situation you can
code in the way it mentioned below.
C If (RRN <= *Zeros)
C Eval *In32 = *OFF
C Else
C Eval *In32 = *ON
C EndIf
Where *In32 is SFLDSP indicator in Subfile code.
------------------OR-------------------
C If (RRN > Zeros)
C EXFMT SFLCTL (Subfile Control Display)
C EndIf
Both ways can be choose to avoid RRN related error.
==========================================================
Except the RRN, There are literally hundreds of other things
that can cause a "session or device error," and each has
exactly one "right" solution.For e.g. there may be chances
that you have not declared the keyword 'SFILE' i.e
SFILE(subfile rcdfmt name : RRN) while declaring
display(subfile) file in F-specs of your program. If so then
one can get the "session or device error".
Therefore, when you get a "session or device error," look at
the job log. In the job log will be a message that will
tell you exactly what the problem is. And also understand
all in better way, one should understand subfile programming
first.
Is This Answer Correct ? | 14 Yes | 0 No |
Post New Answer View All Answers
How many program bind in one module....
how do I play {insert rpg system here}?
What is difference between bind by copy and bind by reference?
How to create a login screen using a command instead of display file.... intention is to get a password field on a command..... how do you achieve this...
thanks mr.Harshad R Suryawaunshi,i'm new to as400 i think you are telling in rpgile i know only rpg400 if possible can you tell in rpg400
1. If there are two programs using same file and 2 users are using the file at the same time and what can be done to allow them both to access? 2. How can remove lock from the file for accessing it by both users?
Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?
what do you mean by an input subfile, what are the keywords required?
What is the purpose of record level identifier?
How can we know running job is batch or interactive?
Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?
What is the difference between iter and do?
How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?
what is kids-rpg?
How do u design a physical file, when you have 2 Unique fields like for eg in A student file student ID and student examination no both are unique