when will come session device error?

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


Please Help Members By Posting Answers For Below Questions

how do I declare a table or array in rpg iv?

726


How Chain operation copies the record's data to the input buffer for the program?

1068


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

542


What is the difference between copybooks and subprocedures in as400?

800


how do I preserve and clean the array?

666






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?

502


How to write record if no field or the field are different in physical file in rpgle ?

472


what is an online rpg?

712


What is the difference between iter and do?

661


How to select highest score of each subject or how to select highest income of every month?

1282


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

1880


is this a rpg channel?

666


how do I declare a minor?

707


what is the difference between do while and do until?

692


during execution, an rpg/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes the following logical steps.

746