I am transferring a non keyed Physical File from an i5 to a .txt file on my PC. Is there a way to force the resulting sequence of records in the .txt file on my PC to be the same as the Physical File on the i5 ?
The sequence is inconsistent, sometime the same, sometimes different.
Software/Hardware used:
iSeries Access for Windows V5R4M0 Service Level SI35287
ASKED:
February 9, 2010 6:55 PM
UPDATED:
February 20, 2010 2:34 AM
Please describe how you are “…transferring a non keyed Physical File from an i5 to a .txt file on my PC.”
FTP? iSeries Access File Transfer? CPYTOIMPF? Your own programming? Something else?
Some transfer methods use SQL for example. With SQL, a sequence is never guaranteed without an ORDER BY clause. Or it might be something else entirely.
Tom
Tom,
As described above I am using iSeries Access for Windows V5R4M0, Data File Transfer.
Thank You,
Bill
Teandy,
That is my problem, I don’t have a field to sort on, I want the .txt file created on my PC in the same sequence as the PF I am doing a Data Transfer from.
Thanks,
Bill
What type of file are you transfering? Is it a flat file (A file that has only one field that contains the data)? Is it a flat file with delimiters between fields?
Teandy,
It is a flat file with only 1 field, 750 characters long, created thru DDS and compiled. No delimeters.
Thanks,
Bill
Try running the following command on you i5:
CPYTOIMPF FROMFILE(My_Flat_File) +
TOSTMF(‘/My_IFS_folder/My_Flat_File.TXT’) +
MBROPT(*REPLACE) STMFCODPAG(*PCASCII) +
RCDDLM(*CRLF) DTAFMT(*FIXED) +
STRDLM(*NONE) FLDDLM(‘|’)
This should create a text file on the IFS called My_Flat_File.txt in folder My_IFS_folder.
You should then be able to map a drive to the IFS folder and pull the file down to your desktop. Once you have the file, see if it is in the order you want.
The only other thing I can think of would be to create a new file with two fields. One field acts as the key for the file and the other holds the data from the flat file. Then read the flat file, pick a from and through position in the flat file field to act as the key and write the key and the data from the flat file to the new file. Then import the new file using iSeries Access for Windows.
Getting to the heart of the question, how do you know what the ‘order’ is on your iSeries? And is your “flat file” a program-described or externally-described file? (If you run DSPFD, is the “Externally described file” attribute ‘Yes’ or ‘No’?)
A reliable solution might require recreating your flat file.
Tom