Hi people,

I debuged my simple java program in the following and found it stopped when it 
reached  "RecordFormat fmt = new AS400FileRecordDescription()" statement. Can 
anyone tell me what the possible problem is? The ports drda, 
as-signon,as-srvmap etc have already opened in AS400.

FYI, I have followed the troubleshooting tips in 
http://www-1.ibm.com/servers/eserver/iseries/toolbox/troubleshooting.htm, but 
still can't solve the problem.

Thanks in advance,

Rong

================================================================
import com.ibm.as400.access.*;
/**
 * 
 * @param 
 * @since Sep 2, 2004
 * 
 */
public class TestFile {
 
 public TestFile() {
 }
  
 public void doit() {
 
  try {
   AS400 as400 = new AS400("192.168.1.40", userName, password);
 
//   as400.connectService(AS400.RECORDACCESS);
 
   as400.setGuiAvailable(false);
   QSYSObjectPathName fileName = new QSYSObjectPathName("%LIBL%", "UTS005TX", 
"%FIRST%","MBR" );
   SequentialFile file = new SequentialFile(as400,fileName.getPath());   
     
   RecordFormat fmt = new 
AS400FileRecordDescription(as400,fileName.getPath()).retrieveRecordFormat()[0]; 
 
   file.setRecordFormat(fmt); 
   file.open(AS400File.READ_ONLY,1, AS400File.COMMIT_LOCK_LEVEL_NONE);
   Record rs = file.readNext();
   while (rs != null)
   { if(rs.getField("T@LANG").toString().equals("E")){
     break;
   }
    rs = file.readNext();
   } 
 
   String lblTitle = rs.getField("T@0001").toString();
   String lblSubNum = rs.getField("T@0002").toString();
   String lblPayAmt = rs.getField("T@0003").toString();
   String lblCode = rs.getField("T@0004").toString();
 
   System.out.println(" title = [" + lblTitle);
 
//   as400.disconnectService(AS400.RECORDACCESS);

  } catch (Exception err) {
   System.out.println(" Error connect to AS/400" + err);
  }
 }
 public static void main(String[] args) {

  TestFile a = new TestFile();
  a.doit(); 
  System.out.println(" this is out from main"); 
 }
}

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.