Ashish,
When you run this program, does it print the message saying "File exist"?
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Ashish Kulkarni
Sent: Monday, February 11, 2008 4:23 PM
To: java400-l@xxxxxxxxxxxx
Subject: CPF3012 Error when trying to retrieve RecordFormat
Hi
I have following code below
AS400 as400 = new AS400();
CommandCall cmd = new CommandCall(as400);
String liblList = "QTEMP MYLIB QGPL";
String command = "CHGLIBL LIBL(" + liblList.trim() +
")";
boolean flag = cmd.run(command);
QSYSObjectPathName filePath = new
QSYSObjectPathName("%LIBL%", "MYFILE", "FILE");
ObjectDescription od = new
ObjectDescription(as400,filePath.getPath());
if(od.exists())
{
System.out.println("File exist");
}
AS400File file = new SequentialFile(as400,
filePath.getPath());
AS400FileRecordDescription recordDescription =
new AS400FileRecordDescription(as400, file.getPath());
RecordFormat[] format =
recordDescription.retrieveRecordFormat();
I am getting at the last statement in the above code,
what am i missing, the file is existing in the library
list.
com.ibm.as400.access.AS400Exception: CPF3012 File
MYFILE in library *LIBL not found.
at
com.ibm.as400.access.AS400FileRecordDescriptionImplRemote.retrieveRecordFormat(AS400FileRecordDescriptionImplRemote.java:1147)
at com.ibm.as400.access.AS400FileRecordDescription.retrieveRecordFormat(AS400FileRecordDescription.java:488)
A$HI$H
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
As an Amazon Associate we earn from qualifying purchases.