Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Running a Java Program through a AS 400 Session

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Running a Java Program through a AS 400 Session

    Alex, I find Java runs excellent on the AS/400 from a CL. Here's a snippet of how I submit my AS/400 job to batch. I have it optimized at 40 which takes a little longer to startup (it compiles itself) but once it's going, it flies. You can use a different option than 40 (*interpret) which will load quicker but run a bit slower. Here's a CL example to get you started. Note the DB2Java.zip driver is how I connect to an RS6000 from the AS400 to keep our databases in synch. I have to do the MONMSG otherwise the java program keeps running (even with errors). The monmsg allows it to exit if it encounters an error. I found this out the hard way. CHGCURDIR DIR('/aix') ADDENVVAR ENVVAR(CLASSPATH) + VALUE('/xaix:/home:/QIBM/ProdData/HTTP/Public+ /jt400/lib/jt400.jar:/xaix/db2java.zip:.:') RUNJVA CLASS(RtvDtaqRS) OPTIMIZE(40) MONMSG MSGID(JVA0000) This job monitors a data queue which is filled with AS/400 transactions. The java program continuously reads the data queue in batch and updates the RS6000. In the Java code, doing a System.out.println('....') will log to a spooled file. This is great for monitoring/debugging transactions and is s o o ooo easy. Jim Quinlan America II Corp Clearwater, Florida

  • #2
    Running a Java Program through a AS 400 Session

    What we are doing here, and forgive my inexpereince in thisI am a OO Programmer and not too familiar with the AS400, is that we have a CL that will read the top library from the worklist, then it will append that value to the command. The command will look like java Browser1 A345654, after the CL has done this it will launch a Batch file that sets up the classpath and recieves/reads the parameters that were passed by the CL, then runs "java Browser1 A345654". I have researched and found out about a java run command on the AS 400 for some reason the AS 400 people here can not get it to run. Thus we have gone this way. Is this why the java Program is running slow?? I need to have evidence or proof that even redoing the program in an other language like VB or VC++ will not improve load up time, because of the way we are going about it. calling it through a CL and not using the runjava command. Are you using this command to run your program? I just really feel strongly about it, and when I do run this java Browser OUTSIDE of the AS400, it runs really good. Thanks for your help.

    Comment


    • #3
      Running a Java Program through a AS 400 Session

      Alexander, I'm not totally clear what you're trying to do but I think I understand. Use the CL, build whatever parameters you need and then use the following commands to run the java on the AS/400. I'll try to translate what the AS/400 is doing This is like starting in a directory named xaix on a PC although it actually is pointing to an IFS directory on the AS/400 where you can store classes. It's easy to create your own directories in the IFS. CHGCURDIR DIR('/xaix') This sets your classpath. Notice the colons to separate the paths unlike PC Classpaths. You may just need the :.: ADDENVVAR ENVVAR(CLASSPATH) + VALUE('/xaix:/home:/QIBM/ProdData/HTTP/Public+ /jt400/lib/jt400.jar:/xaix/db2java.zip:.:') This runs your java program: RUNJVA CLASS(Browser1(A345654)) OPTIMIZE(40) In this case, put your Browser1 java classes in directory xaix in the IFS on the AS/400. WRKLNK is a way to navigate the IFS, Also you could use network neighborhood and create a directory to store your Java classes ON THE AS/400. However, I would not do a RUNRMTCMD and execute a batch file off of a PC from an AS/400 command. That would be very inefficient in my opinion. However I'm not sure how the browser classes would run on the AS/400 either ... I would be very interested in knowing if it does work though. Let me know. I think you're on the right track in your thinking. The example code I posted to you actually runs on my AS/400 although I just renamed some of the directories in the example. Let me know if I can be of any more assistance. Jim Quinlan America II Clearwater, Florida www.americaii.com

      Comment


      • #4
        Running a Java Program through a AS 400 Session

        I have read your posting and I guess you are the right person to ask. I am new to AS/400. I have good exp. in Java on Unix and NT. I will be working on Java Development on As/400. So, Can you suggest me good books to start AS/400 ? I do not know how much of As/400 side I need to know to do java development. Please let me know is it very hard or ok kind of exp. for Java dev. on AS/400. Your suggestion is appriciated. Thanks Venu

        Comment


        • #5
          Running a Java Program through a AS 400 Session

          Your command: ADDENVVAR ENVVAR(CLASSPATH) + VALUE('/xaix:/home:/QIBM/ProdData/HTTP/Public+ /jt400/lib/jt400.jar:/xaix/db2java.zip:.:') Could you hep me understand this? Is ':/home:' mean where the jt400.jar is located on the 400? Also, '/xaix/db2java.zip:.:' what is the :.: stand for? Thanks in advance. DannyN

          Comment


          • #6
            Running a Java Program through a AS 400 Session

            About anything you'd ever need on the subject is sold on our store. For Java, see: http://mc-store.com/java.html Sean

            Comment


            • #7
              Running a Java Program through a AS 400 Session

              We are running a Java Program using a CL. The Java Code itself seems to connect quickly to the AS 400, however the loading time of this program is very slow. Why is there such decreased performance?? Is it because we are running a CL, that opens a PCO session then runs a batch that launches theprogram or could it be the Java Program itself. I am of the opinion that the slow down is the CL,PCO and Batch combo not the program, and writting the program in VB or any other language would cause the same isssue. Decreased performance! I need some input please! -Alex.

              Comment


              • #8
                Running a Java Program through a AS 400 Session

                Trying to make a connection via HTTPs from the 400. My codes: CHGCURDIR DIR('/JAVACLASS') ADDENVVAR ENVVAR(CLASSPATH) + VALUE('/JAVACLASS:/QIBM/ProdData/HTTP/Publi+ c/jt400/lib/jt400.jar') RUNJVA CLASS(GEPartSend) + PARM('https://genet.geappliances.com/eparts+ sales/Dispatcher?REQUEST=CONNSORDER' + '/QDLS/DNGUYEN/TEST.TXT') + CLASSPATH('/JAVACLASS') OPTIMIZE(40) MONMSG MSGID(JVA0000) When I run this, I'm getting an exit code of 1. Can anyone see what I am not doing right? Thanks in advance.

                Comment


                • #9
                  Running a Java Program through a AS 400 Session

                  DannyN wrote: > > Your command: ADDENVVAR ENVVAR(CLASSPATH) + > VALUE('/xaix:/home:/QIBM/ProdData/HTTP/Public+ > /jt400/lib/jt400.jar:/xaix/db2java.zip:.:') > > Could you hep me understand this? Is ':/home:' mean where the jt400.jar is located on the 400? Also, '/xaix/db2java.zip:.:' what is the :.: stand for? > The classpath is a list of directories, separated by ':'. Your classpath has the following directories: /xaix /home /QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar /xaix/db2java.zip . The last one, "." means "current directory". jt400.jar is in directory /QIBM/ProdData/HTTP/Public/jt400/lib

                  Comment

                  Working...
                  X