0
votes

I want to run jcl job with java source code embedded with job itself. I found some cobol examples whose source code is written within SYSIN DD * or SYSIN DD DATA and tried the same with java program.

Here is my job:

    //JHELLO JOB MSGLEVEL=(1,1),REGION=0M,CLASS=A,MSGCLASS=A,
    // NOTIFY=&SYSUID                                        
    //JOMVS    EXEC PGM=BPXBATCH,REGION=0M,TIME=NOLIMIT      
    //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=*                                   
    //STDENV   DD *                                          
    //                                                        

After submitting, Job terminates with this message.

this message (appended output file in the same image)rather than hello :) output.

Note: I do not want to access the .java program nor java program as .sh shell script through parm statement.

Thank you,

Edit: Attached code, Removed screenshot

1
Please post code, not a screenshot of code - Vasfed
As you've been told before, screenshots are a pain. Highlight in your emulator, copy and paste. Nothing simpler, and it means people can take your code, output and data and try it out. Also paste an example of how you are compiling a Java program from a library, and your JCL to run that program. - Bill Woodger
Read up on what BPXBATCH is. It will become obvious it knows nothing about your program. For the output you need to look at the STDERR or STDOUT dataset for the step, not the SYSOUT. - Bill Woodger
It's doing exactly what you are telling it to do, feeding a Java program as input into BPXBATCH, which is the JCL batch shell program. Now think about how bash, ksh, or sh would react if you fed a Java program into it as input. Please do more research, including how to do what you want in a standard UNIX® environment. - zarchasmpgmr
@bill, please check this link for library...i changed the job...stackoverflow.com/questions/34795181/… - user1

1 Answers

0
votes

I'd suggest that you follow this link BPXBATCH utility

I've never used the utility. But with a fleeting scan saw that the PARM field is probably required. e.g.

//STEP001 EXEC PGM=BPXBATCH, PARM="your parms here"