ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

JAVA command parm size limit?

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

  • JAVA command parm size limit?

    I've been running a Java program from a "greenscreen" CL program. But when I adjusted the variable size for &URL to 300 in the CL program, I received a runtime error saying:

    CALL QGPL/DPSSCL
    Value 'http://eas' for PARM exceeds 256 characters.
    Error found on JAVA command.
    Function check. CPF0001 unmonitored by DPSSCL at statement 6600,
    instruction X'0034'.
    CPF0001 received by DPSSCL at 6600. (C D I R)
    CPF0001 received by DPSSCL at 6600. (C D I R)

    Have you run into anything like this? What am I doing wrong?

  • #2
    Re: JAVA command parm size limit?

    What version are you on V5R??

    Thanks
    Jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: JAVA command parm size limit?

      Thanks for your response. We're on v5r3m0.

      dd

      Comment


      • #4
        Re: JAVA command parm size limit?

        Please make your source type CLLE instead of CLP and you will be fine

        Code:
                   PGM        PARM(&INPARM)                          
                   DCL        VAR(&INPARM) TYPE(*CHAR) LEN(2000)     
                                                                     
                   CALL       PGM(@BIGPARM2) PARM(&INPARM)           
                                                                     
                                                                     
          exit:    ENDPGM
        program BIGPARM2 (below)
        Code:
                     PGM        PARM(&INPARM)                            
                     DCL        VAR(&INPARM) TYPE(*CHAR) LEN(2000)       
                                                                         
                     chgvar &inparm  'test enterrtfdgdfggd'              
                                                                         
            exit:    ENDPGM

        From the error it looks like it might be a JAVA problem Sorry I dont know JAVA are the parm length hardcoded in JAVA......could that be your issue? May we see some of the program DPSSCL
        maybe the declares and lines around 6600

        Jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: JAVA command parm size limit?

          Here's the code:
          Code:
          
          0001.00 /* ==========================================================================*/    
          0002.00 /* DPSSCL: Denied Party Screening                                            */    
          0003.00 /*                                                                           */    
          0004.00 /* Created 07.19.2005 wdd                                                    */    
          0005.00 /*                                                                           */    
          0006.00 /* Modifications:                                                            */    
          0007.00 /*                                                                           */    
          0008.00 /* ==========================================================================*/    
          0009.00                                                                                    
          0010.00              PGM        PARM(&KEY_NM &NAME &ADDRESS1 &ADDRESS2 +                   
          0011.00                           &CNTRY_CODE &ORDER_NUM &EMAIL &BATCH)                    
          0012.00 /*                                                                             +   
          0013.00  [url]http://66.255.99.92:8888/dpss/resultHostedService.ocr[/url]  (OBSOLETE)             +   
          0014.00                                                                                +   
          0015.00    Sample URL to pass:                                                         +   
          0016.00                                                                                +   
          0017.00  [url]http://easehost.ocr-inc.com/dpss/resultHostedService.ocr[/url]                      +   
          0018.00                                                                                +   
          0019.00    Parms:                                                                      +   
          0020.00     ?load_data=Y                                                               +   
          0021.00     &screen_data=Y                                                             +   
          0022.00     &Total=1                                                                   +   
          0023.00     &a_entityid=1                                                              +   
          0024.00     &key_nm=test1                                                              +    
          0025.00     &fld_type=                                                                 +    
          0026.00     &name=SaddamHussein                                                        +    
          0027.00     &cntry_code=                                                               +    
          0028.00     &address1=                                                                 +    
          0029.00     &address2=                                                                 +    
          0030.00     &screen_status=                                                            +    
          0031.00     &username=tww                                                              +    
          0032.00     &email=ddaugherty@teamair.com                                              +    
          0033.00                                                                           */        
          0034.00              DCL        VAR(&URL1) TYPE(*CHAR) LEN(256)                             
          0035.00              DCL        VAR(&URL2) TYPE(*CHAR) LEN(256)                             
          0036.00              DCL        VAR(&SITE) TYPE(*CHAR) LEN(56) +                            
          0037.00                           VALUE('http://easehost.ocr-inc.com/dpss/res+              
          0038.00                           ultHostedService.ocr')                                    
          0039.00                                                                                     
          0040.00              DCL        VAR(&LOAD_DATA) TYPE(*CHAR) LEN(1) VALUE('Y')               
          0041.00              DCL        VAR(&SCRN_DATA) TYPE(*CHAR) LEN(1) VALUE('Y')               
          0042.00              DCL        VAR(&TOTAL) TYPE(*CHAR) LEN(1) VALUE('1')                   
          0043.00              DCL        VAR(&A_ENTITYID) TYPE(*CHAR) LEN(1) VALUE('1')              
          0044.00              DCL        VAR(&FLD_TYPE) TYPE(*CHAR) LEN(1)                           
          0045.00              DCL        VAR(&SCREEN_STS) TYPE(*CHAR) LEN(1) VALUE('T')              
          0046.00                                                                                     
          0047.00              DCL        VAR(&KEY_NM) TYPE(*CHAR) LEN(50)
          0048.00              DCL        VAR(&NAME) TYPE(*CHAR) LEN(50)                             
          0049.00              DCL        VAR(&ADDRESS1) TYPE(*CHAR) LEN(50)                         
          0050.00              DCL        VAR(&ADDRESS2) TYPE(*CHAR) LEN(50)                         
          0051.00              DCL        VAR(&CNTRY_CODE) TYPE(*CHAR) LEN(2)                        
          0052.00              DCL        VAR(&ORDER_NUM) TYPE(*CHAR) LEN(100)                       
          0053.00              DCL        VAR(&EMAIL) TYPE(*CHAR) LEN(200)                           
          0054.00              DCL        VAR(&EMAIL2) TYPE(*CHAR) LEN(200) +                        
          0055.00                           VALUE('randy@teamoceanservices.com')                     
          0056.00              DCL        VAR(&EMAIL3) TYPE(*CHAR) LEN(200) +                        
          0057.00                           VALUE('ddaugherty@teamair.com')                          
          0058.00                                                                                    
          0059.00              DCL        VAR(&CLASSPATH) TYPE(*CHAR) LEN(75)                        
          0060.00              DCL        VAR(&DPSS) TYPE(*CHAR) LEN(4)                              
          0061.00              DCL        VAR(&MBR) TYPE(*CHAR) LEN(10)                              
          0062.00              DCL        VAR(&MBRDESC) TYPE(*CHAR) LEN(35)                          
          0063.00              DCL        VAR(&USERNAME) TYPE(*CHAR) LEN(3) VALUE('tww')             
          0064.00              DCL        VAR(&DATETIME) TYPE(*CHAR) LEN(20)                         
          0065.00                                                                                    
          0066.00              DCL        VAR(&BATCH) TYPE(*CHAR) LEN(10)                            
          0067.00              DCL        VAR(&BATCH#) TYPE(*DEC) LEN(10 0)                          
          0068.00                                                                                    
          0069.00 /* Set Variable Parm Values                                                */      
          0070.00 /*           CHGVAR     VAR(&URL) +                                                
          0071.00                           VALUE('http://easehost.ocr-inc.com/dpss/res+             
          0072.00                           ultHostedService.ocr?load_data=Y&screen_dat+              
          0073.00                           a=Y&Total=1&a_entityid=1&key_nm=BinLadenKey&+             
          0074.00                           fld_type=&name=BinLaden&cntry_code=&address1+             
          0075.00                           =&address2=&screen_status=T&username=tww&em+              
          0076.00                           ail=ddaugherty@teamair.com&order_num=123456') */          
          0077.00                                                                                     
          0078.00              CHGVAR     VAR(&URL1) +                                                
          0079.00                           VALUE(&SITE           *TCAT +                             
          0080.00                                 '?load_data='   *TCAT +                             
          0081.00                                 &LOAD_DATA      *TCAT +                             
          0082.00                                 '&screen_data=' *TCAT +                             
          0083.00                                 &SCRN_DATA      *TCAT +                             
          0084.00                                 '&Total='       *TCAT +                             
          0085.00                                 &TOTAL          *TCAT +                             
          0086.00                                 '&a_entityid='  *TCAT +                             
          0087.00                                 &A_ENTITYID     *TCAT +                             
          0088.00                                 '&key_nm='      *TCAT +                             
          0089.00                                 &KEY_NM         *TCAT +                             
          0090.00                                 '&fld_type='    *TCAT +                             
          0091.00                                 &FLD_TYPE)                                          
          0092.00                                                                                     
          0093.00              CHGVAR     VAR(&URL2) VALUE('&name=' *TCAT &NAME *TCAT +               
          0094.00                           '&address1=' *TCAT &ADDRESS1 *TCAT +                      
          0095.00                           '&address2=' *TCAT &ADDRESS2 *TCAT +                      
          0096.00                           '&cntry_code=' *TCAT &CNTRY_CODE *TCAT +                  
          0097.00                           '&screen_sts=' *TCAT &SCREEN_STS *TCAT +                  
          0098.00                           '&username=' *TCAT &USERNAME *TCAT +                      
          0099.00                           '&email=' *TCAT &EMAIL3 *TCAT +                           
          0100.00                           '&order_num=' *TCAT &ORDER_NUM)                           
          0101.00                                                                                     
          0102.00              CHGDTAARA  DTAARA(*LDA) VALUE(&URL1 *TCAT &URL2)                       
          0103.00              DSPDTAARA  DTAARA(*LDA) OUTPUT(*PRINT)                                 
          0104.00                                                                                     
          0105.00              CHGVAR     VAR(&CLASSPATH) +                                           
          0106.00                           VALUE('/dpss:/dpss/xml-apis.jar:/QIBM/ProdD+              
          0107.00                           ata/OS400/jt400/lib/jt400Native.jar')                     
          0108.00                                                                                     
          0109.00              CHGVAR     VAR(&DPSS) VALUE('DPSS')                                    
          0110.00                                                                                     
          0111.00 /* Get Next Batch #                                                        */       
          0112.00              RTVDTAARA  DTAARA(QGPL/DPSSBATCH) RTNVAR(&BATCH#)                      
          0113.00              CHGVAR     VAR(&BATCH#) VALUE(&BATCH# + 1)                             
          0114.00              CHGDTAARA  DTAARA(QGPL/DPSSBATCH) VALUE(&BATCH#)                       
          0115.00              CHGVAR     VAR(&BATCH) VALUE(&BATCH#)                                  
          0116.00 /* Call Java program with parms                                            */       
          0117.00                                                                                     
          0118.00              JAVA       CLASS(DpssHttpAPI) PARM(&URL1 &URL2 &DPSS +                 
          0119.00                           &BATCH) CLASSPATH(&CLASSPATH) +                           
          0120.00                           OPTIMIZE(*INTERPRET) INTERPRET(*YES) +                    
          0121.00                           OUTPUT(*PRINT)                                            
          0122.00                                                                                     
          0123.00  ENDPGM:     ENDPGM

          Comment


          • #6
            Re: JAVA command parm size limit?

            Sorry again I donot know java but you need to check this
            Code:
            0118.00              JAVA       CLASS(DpssHttpAPI) PARM(&URL1 &URL2 &DPSS +                 
            0119.00                           &BATCH) CLASSPATH(&CLASSPATH) +                           
            0120.00                           OPTIMIZE(*INTERPRET) INTERPRET(*YES) +                    
            0121.00                           OUTPUT(*PRINT)
            IBM says it cant be greater than 200 --there must be another way to do this...
            sorry I cant help more.


            Code:
             Help                       Parameters (PARM) - Help                           
                                                                                           
                 Specifies one or more parameter values that are passed to the Java        
                 program.  A maximum of 200 parameter values can be passed.                
                                                                                           
                 *NONE                                                                     
                     There are no input parameters to the Java program.                    
                                                                                           
                 parameter-value                                                           
                     Specify the parameter value to be passed to the Java program.
            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment


            • #7
              Re: JAVA command parm size limit?

              It almost reads like the "number" of parms cannot be greater than 200 rather than the size of a parm cannot be greater than 200, doesn't it?

              Thanks for your help on this...

              dd

              Comment


              • #8
                Re: JAVA command parm size limit?

                Oh! Crap your right .....Sorry It is Monday....

                in my example above I had parameters of 2000 please comment out the JAVA code
                and try to recompile...My guess is it will compile fine...(as mine did)

                at least then we will know its not a proble with The CL program.

                Thanks
                Jamie
                All my answers were extracted from the "Big Dummy's Guide to the As400"
                and I take no responsibility for any of them.

                www.code400.com

                Comment


                • #9
                  Re: JAVA command parm size limit?

                  Oh stewardess! I speak jive.

                  Attached is a simple program that will display the parms being passed into the mainline of a java program. Change the file extension of this file to .java and place it into the IFS in a directory of java with a subdirectory of test. Compile this program and execute the CL below.

                  Code:
                  0001.00              PGM                                                                    
                  0002.00                                                                                     
                  0003.00              DCL        VAR(&URL1) TYPE(*CHAR) LEN(2000)                            
                  0004.00              DCL        VAR(&URL2) TYPE(*CHAR) LEN(2000)                            
                  0005.00              DCL        VAR(&DPSS) TYPE(*CHAR) LEN(2000)                            
                  0006.00              DCL        VAR(&BATCH) TYPE(*CHAR) LEN(2000)                           
                  0007.00              DCL        VAR(&CLASSPATH) TYPE(*CHAR) LEN(2000)                       
                  0008.00              CHGVAR     VAR(&URL1) VALUE('http:\\blahblahblah')                     
                  0009.00              CHGVAR     VAR(&URL2) VALUE('blah2blah2blah2')                         
                  0010.00              CHGVAR     VAR(&DPSS) VALUE('blah3blah3blah3')                         
                  0011.00              CHGVAR     VAR(&BATCH) VALUE('blah3blah3blah3')                        
                  0012.00              CHGVAR     VAR(&CLASSPATH) VALUE('/java/Test')                         
                  0013.00              JAVA       CLASS(TestCL) PARM(&URL1 &URL2 &DPSS &BATCH) +              
                  0014.00                           CLASSPATH(&ClASSPATH)                                     
                  0015.00                                                                                     
                  0016.00                                                                                     
                  0017.00
                  When I run this on my system all the parms that I passed in through the CL are diplayed on the java console.

                  Let me know if this works.

                  Run your command again and post the joblog for the "Error on java" statement.

                  You can swap out this program for yours in the CL to see what your parms look like once they are passed into the mainline.

                  I hope this helps.
                  Attached Files
                  Last edited by kpmac; October 24, 2005, 09:39 AM.
                  Predictions are usually difficult, especially about the future. ~Yogi Berra

                  Vertical Software Systems
                  VSS.biz

                  Comment


                  • #10
                    Re: JAVA command parm size limit?

                    KPMAC

                    Airplane reference.....I like it...Thanks for helping me out once again.

                    Jamie
                    All my answers were extracted from the "Big Dummy's Guide to the As400"
                    and I take no responsibility for any of them.

                    www.code400.com

                    Comment


                    • #11
                      Re: JAVA command parm size limit?

                      The long parms displayed just fine. I'll try reloading with real data and see what happens..

                      Thanks KPMAC and Jamie!

                      Comment


                      • #12
                        The PARMs have a maximum length of 256 as the error states. The variable length passed can be arbitrarily long, but the contents are limited. Very annoying and poorly documented (if at all).

                        Comment

                        Working...
                        X