when will come session device error?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / katiyar
The Session and Device error occurs when program tries to
load data to display file (Subfile). The program should have
correct logic to load data from Database file to Subfile
using RRN(Relative Record Number). Then only data will be
loaded successfully to display file (subfile) else it will
be encountered with session and device error.
To prevent Session and Device error, One should understand
the Display file (Subfile) programming.
Is This Answer Correct ? | 11 Yes | 3 No |
Answer / raj
1. If RRN is not incresing correctly
2. If sfldsp and sfldspctl are set on proparlly
3. In load all if records exceeds 9999 and even less than
zero
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / sahish
Check the records are write in sub file
write sfl
for each record
Is This Answer Correct ? | 0 Yes | 1 No |
What you have to do in the display file when you are using message subfile?
1)how to do date validation in rpg? 2)how to delete dUPLICATE RECORDS?
what is mean by *MAP and *DROP?what commands use these two keywords?why are they used?
The RP program is displaying records 11 times .But there are 10 records in a pf.(ie last record is displayed twice).How to display records only 10 times?
Can an indexed file be accessed in arrival sequence in RPG?
How to call one program from another program in RPG? please help me with the code
what is flat file?
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?
i'm working on progA , in that program i want to see the userids of the users who work on this program?
Why Rpg/400 is Famous?
Q1.How we can copy the data of file one session to another session? Q2.how we can execute a loop infinitely in AS/400 coding? Q3.In ALDON tool,multitask is posible on a perticular object by the user?
In case if I want to know whether a record exists in a file, which one do you prefer CHAIN or a SETLL and why ?