when will come session device error?

Answers were Sorted based on User's Feedback



when will come session device error?..

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

when will come session device error?..

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

when will come session device error?..

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

when will come session device error?..

Answer / sahish

Check the records are write in sub file

write sfl

for each record

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More RPG400 Interview Questions

I have two sessions S1 & S2 under this 3 jobs(say j1,j2,j3 under session S1) And 2 jobs(Say j4, j5 Under session S2)is running. How many QTEMP & how many LDA will create for the same.

9 Answers   IBM,


When PGMA calls PGMB for the first time PGMB executes the *INZSR. PGMB uses the RETRN operation to return to PGMA. When PGMA call PGMB the second time is the *INZSR executed?

5 Answers   Mphasis,


how does the rpg element work?

0 Answers   IBM,


how to change the length of the field in a physicalfile?

12 Answers  


Write the subfile logic program for the given concept. Load the data to the subfile depends upon the designation where designation is not a key field?

2 Answers   TCS,






what are the key words you must use when using a subfile?

0 Answers   IBM,


what built in function can be used with SETLL.If you want to check whether the search argument is successful or not? Please give me answer with example?

3 Answers  


How to call one program from another program in RPG? please help me with the code

0 Answers   HCL,


suppose if we want to update the data in cl what we will do?

9 Answers  


Anybody know the difference of primary file and full procedural file

4 Answers  


How can we call CL program to RPG? How many number of parameter we can pass

2 Answers   TCS,


Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.

0 Answers  


Categories