0

JOB Description: JVMLDM76 library is in the dataset WLM.ABC.DEF.LINKLIB.PDSE. JVMLDM76(load module) comes with jzos batch launcher tool kit installation.

Here is my job:

    //JHELLO JOB MSGLEVEL=(1,1),REGION=0M,CLASS=Q,MSGCLASS=A 
    /* NOTIFY=&SYSUID */                                     
    //JOMVS EXEC PGM=JVMLDM76,REGION=0M,TIME=NOLIMIT         
    //STEPLIB  DD DSN=WLM.ABC.DEF.LINKLIB.PDSE,DISP=SHR  
    //SYSIN    DD  *                                         
    /* program starts here */                                
    public class JHelloWorld                              
    {                                                     
        public static void main(String args[])              
        {                                                  
           System.out.println("Hello :)");                 
        }                                                  
    }                                                    
    //*                                                      
    //STDOUT   DD SYSOUT=*                                   
    //SYSPRINT DD SYSOUT=*                                   
    //STDERR   DD SYSOUT=*                                   
    //

Error:

No java class name argument supplied. Jzos batch launcher failed, return code=101

Queries:

  1. Can i send java program only as class file like JOMVS EXEC PGM=JVMLDM76,REGION=0M,TIME=NOLIMIT,JAVACLS = Hello ?(this works fine)

  2. Is there any way to integrate java source code with jcl ? I cannot change load module. It is encrypted.

  3. While i am transferring my java program from workstation to host (ascii transfer mode), Special character [] in program at 'main(String args[])' is getting disappeared. If i type it in jcl, it is working fine. can someone tell reason for this ? i have seen this link.but, didnt find any documentation regarding this. Is there a list of Special characters to be avoided in JCL/MVS Script variables

Thanks for your attention,

SHR
  • 7,940
  • 9
  • 38
  • 57
user1
  • 391
  • 3
  • 27
  • 1
    Number 3 is a separate question, if you can't get to it. It would seem that you have a "codepage" problem. The value of [ in the ASCII-codepage you are using is not translating to the correct symbol in the EBCDIC-codepage you are using. Consult your technical staff. – Bill Woodger Jan 14 '16 at 17:22
  • 1
    Don't use TIME=NOLIMIT. If you get a Big Fat Loop, you will suck up a lot of CPU time, and that will upset someone. TIME=(,2) will give you loads of processing time. – Bill Woodger Jan 14 '16 at 17:23
  • Why does the Java program source have to be instream? – zarchasmpgmr Jan 14 '16 at 22:09
  • @BillWoodger thanks. – user1 Jan 15 '16 at 11:33
  • @BillWoodger, i found where my mistake is in 3rd query. characters became invisible when i did cut paste from windows workstation to other platform. when i opted the option convert ascii to ebcdic during ftp transfer, characters are getting displayed normally. – user1 Jan 20 '16 at 14:45

1 Answers1

1

Java is not an interpreted language. It needs to be compiled into a bytecode *.class or *.jar file and then executed. To do what you want to do would require a more sophisticated batch launcher like Co:Z batch from Dovetailed technologies https://dovetail.com/docs/coz/coz_index.html. Dovetailed are the original authors of JZOS.

//COZBATCH JOB CLASS=W,NOTIFY=&SYSUID                                  
//*                                                                    
//JOBLIB  DD DISP=SHR,DSN=COZ.LOADLIB                                  
//*                                                                    
//*====================================================================
//* Batch job to run the CoZLauncher.                                  
//*====================================================================
//RUNCOZ  EXEC PGM=COZBATCH                                            
//STDIN  DD *                                                          
cd /tmp                                                                
mkdir -p hello                                                         
cd hello                                                               
cat >HelloWorld.java <<EOF                                             
public class HelloWorld {                                              
   public static void main(String[] args) {                            
        System.out.println("Hello World!");                            
   }                                                                   
}                                                                      
EOF                                                                    
export JAVA_HOME=/usr/lpp/java/J7.1_64                                 
export PATH=$PATH:$JAVA_HOME/bin                                       
javac HelloWorld.java                                                  
java HelloWorld                              
/*   
David Crayford
  • 571
  • 1
  • 3
  • 10