25 pts.
 Declaring the same file twice with two OPENID and reading the same file twice in CL Program
 Is it posssible read a db file while declaring twice with openID     and reading the same file twice

Software/Hardware used:
AS400
ASKED: March 23, 2011  3:32 AM
UPDATED: March 24, 2011  10:38 PM

Answer Wiki:
If you mean read the same file concurrently, I believe you would DCLF two different file names. Like a PF and and LF. If you mean read through it once and now you want to read through it again, the just declare it one and use POSDBF Here is a link to other discussion on this issue: http://forums.systeminetwork.com/isnetforums/showthread.php?t=42943
Last Wiki Answer Submitted:  March 23, 2011  1:09 pm  by  CharlieBrowne   32,785 pts.
All Answer Wiki Contributors:  CharlieBrowne   32,785 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Since it takes four trivial statements to test this (six if you want a fairly exhaustive test), it would be easier to run a live test than to ask the question and wait/watch for an answer. That makes it hard to view this as a “business problem” rather than a “homework/interview problem”.

Tom

 107,735 pts.

 

You can, depending on the release level of your system, either use two DCLFs with unique OPNIDs; or have one DCLF, use the CLOSE command when you’re done reading the file the first time, and then use a RCVF against the closed file. The RCVF will re-open the file for further processing.

 6,055 pts.

 

Bruce
If you do a CLOF and and then a 2nd RCVF is the cursor at the first record, or do yo uneed to do a POSDBF?

 32,785 pts.

 

After the CLOSE (note that the command to use is CLOSE, not CLOF) the next RCVF will be positioned at the first record within the (implicitly opened) file.

 6,055 pts.