5 pts.
 IFS – records in file are not in original sequence
I am not a AS400 developer. I work on an RS6000 (Unix) but we use IFS (NFS) to exchange interface files. Has anyone on V5R4 experienced having the records, in a large file, be out of order when a file from a libray is copied to an IFS directory? I am experiencing this and have been told that IBM did make a change about 2 yrs ago to speed things up and it initially had a problem and was patched. The change, as explained to me, is, with large files, the data transfer protocal will automatically switch to transfer blocks instead of bytes. That's all fine with me. But why would they not put the file back together in the proper sequence? Please help point us in the right direction or help me ask my engineers better questions? Thanks daves

Software/Hardware used:
ASKED: December 26, 2007  9:01 PM
UPDATED: March 9, 2010  7:33 AM

Answer Wiki:
Theory - If the file beeing copied has not been reorganized or copied in key order, it will not be in key order when copied sequentially . Either reorg the file first to be in key order then copy to IFS to see if that corrects the problem. ============================================================== I'm not aware of any definition of CPYTOIMPF that says order will be maintained. Nor can I think of any way to guarantee order in any case without either processing by key or through an ORDER BY clause. Since CPYTOIMPF uses neither, I'd say that you probably should use a method that guarantees order if order is important. Tom
Last Wiki Answer Submitted:  March 7, 2010  11:50 am  by  Rickmcd   1,480 pts.
All Answer Wiki Contributors:  Rickmcd   1,480 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

My experience with the CPYF is that it copies based on the primary keys in the order of the SENDING file. If there are no keys, it uses the Relative Record Number (RRN). Maybe it works the same with CPYTOIMPF?

 880 pts.

 

One potential complication is that CPYTOIMPF is based internally on SQL. (You can see evidence running under debug.) SQL doesn’t guarantee an order without an ORDER BY clause. And there is no access to ORDER BY with CPYTOIMPF (AFAIK).

Tom

 107,735 pts.