網頁

2011年6月4日 星期六

Java with AS400's Spooled File

Introduction,
Jtopen develop the solution for AS400 access, that included System/File and database access. This page shows some successful information for using SpooledFile.
SpooledFile is AS400  implenets for output file, that including RPG/CL usage.
Jtopen can using 2 type of access, one is single file, another is using list.

Single file access, the stage for using

  1. System connection : AS400()
  2. Setup OutputQueue: 
  3. setup  Spooled fille 
System Connection :
   the stage for conneciton as folow:
  • new AS400 : pass: system user id password.
  • Service : PRINT, FILE
Setup OutputQueue
OutputQueue identify output query , the cnstructor is   
OutputQueue(AS400 system, String queueName)
as default if the Command does not set any output attribue : queuename could set as /QSYS.LIB/QUSRSYS.LIB/QPRINT.OUTQ

Setup SpooledFile
SpooledFile(
AS400 system,
String spoolfiename,
int jobnumber,
String jobname,
String jobUser,
String jobnumber);

      AS400 system,
      String spoolfiename,
      int jobnumber,
      String jobname,
      String jobUser,
      String jobnumber);
then using
copy(OutputQueue outputQueue)    
move(SpooledFile targetSpooledFile)
  to make to java Stream type

Possible Source as following:





MutiFileAccess
Muti-File, in JTopen , recommend use SpooledFileList() then it can access by QueueFileter and Enumeration , read and send output file possible using PrintObjectTransformedInputStream to read .



Possible Solution :

In some statement, using FTP can solve the same effect, However, using Command call and read file doing the same time, it should solve some trouble

Reference:

JTOpen: http://jt400.sourceforge.net/