Finding out, if file is not assigned in JCL



Support for Java SE, EE & ME, JVM, JNI, JDBC, EJB, JFC, JPDA, JAAS,JCE, JAXP, XML and Java API.

Finding out, if file is not assigned in JCL

Postby olivermf » Fri Jun 17, 2011 6:10 pm

Hello together,

I have a problem in my Java Batch utility.
In my code I assign files from the JCL-Job to IRandomAccessRecordFiles.
If I do not assign the file my Java program does not recognize it and simply runs without any exceptions:

IRecordFile file = RecordFile.getInstanceOf("//DD:SYS021");
IRandomAccessRecordFile rfile = RandomAccessRecordFile.getInstanceOf(file,
               IConstants.JRIO_READ_WRITE_MODE);


In JCL I tested running the program with or without the SYS021-DD-Statement and both won't produce any errors...

//SYS021  DD DSN=USER1.TEST800,DISP=SHR Ausgabedatei

or
//*SYS021  DD DSN=USER1.TEST800,DISP=SHR Ausgabedatei


The method exists() of IRecordFile does not help me, because it is always true...

If I read files I can simply ask if the first read-command is -1 and then throw an Exception, but what can I do with a new, empty outfile?

Regards

Oliver
olivermf
 
Posts: 53
Joined: Tue Feb 08, 2011 4:28 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Finding out, if file is not assigned in JCL

 

Return to Mainframe Java

 


  • Related topics
    Replies
    Views
    Last post