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 hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the logical files in one RPG program? if yes what i have to d.

5 Answers   TCS,


Anybody can explain the difference between SFLCLR & SFLINZ?

7 Answers  


How can we make use of SETLL operation in CL?

11 Answers  


How can we access Interactive job LDA in Batch Job?. and How we can access a file in interactive QTEMP lib in Batch job?.

4 Answers   IBM,


1.Can any body share me about thease opcodes with example please.Im new for AS/400.Could u please tell me in real senario? 1.TESTN, 2.EVAL 3.EVALR, TIME, 4.MONITOR 5. ENDMON 6.ON-ERROR 7.COMMIT ROLLBACK?

1 Answers   CSC,






Hi,This is raju.Can any body give me the real experience answer for this question? 1.What is the significance of *MAP and *DROP in the CPY command?

3 Answers  


steps for debugging two rpg programs????

4 Answers  


What is significance of a file designated as a Primary file in Rpg400 program....also what's use of secoundry file

1 Answers  


do you use message subfiles? What are the necessary keywords required coding a message subfile?

0 Answers   IBM,


I have one cl program which calls two rpg programs named a & b. I am loading a run time array in Pgm A and the control comes back to cl pgm. i call pgmb and I want to read the runtime array in pgmb which was loaded in pgma. How it can be acheived. I should not use any intermediate file or dataarea to store the loaded values.

2 Answers  


i want to perform uniqness on db file bt my db file nt hving key by useing rpgle.

3 Answers   HSBC,


what is edit word and edit code

0 Answers   Cap Gemini,


Categories