View previous topic :: View next topic
|
Author |
Message |
HenriqueS
New User
Joined: 17 Feb 2007 Posts: 30 Location: Brazil
|
|
|
|
Folks,
I am being able to read a sequential file with JRIO*, but I am not being able to access a DDNAME that points to a SYSYIN-like stream or to a file (DSN). See my code below...
When I run the job, it goes straight to EOF...why is this happening?
JCL
Code: |
//BPXBATCH EXEC PGM=BPXBATSL,REGION=0M,
// PARM='SH java -cp .:/tmp DDName DD:TEST'
//TEST DD *
TEST 1
TEST 2
TEST 3
TEST 4
TEST 5
/*
|
Java
Code: |
import com.ibm.recordio.*;
import java.io.*;
public class DDName implements IConstants{
public static void main(String args ){
DDName ddn = new DDName();
ddn.readSYSIN("TEST"); //trying to read a DDNAME called TEST
}
public void readSYSIN(String DDNAME){
try{
System.out.println("try{");
IFileInputRecordStream first =
new FileInputRecordStream("//DD:" + DDNAME);
byte buffer = new byte JRIO_MAX_RECORD_LENGTH ;
for(;;){
int bytesRead = first.read(buffer);
if (bytesRead != JRIO_READ_EOF){
System.out.println(new String(buffer));
}else{
System.out.println("EOF");
break;
}
}
first.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
|
* I have no JZOS installed on my LPAR and there is some bureaucracy putting it up... |
|
Back to top |
|
|
HenriqueS
New User
Joined: 17 Feb 2007 Posts: 30 Location: Brazil
|
|
|
|
Some extra info from runtime. Seems the file is found by the API, but no data is retrieved at all.
Code: |
exists()? true
canRead()? true
canWrite()? true
getRecordFormat()? FB
getRecordLength()? 80
length()? -1
getCanonicalPath()? //DD:TEST
|
According to the JRIO API, length returns 0 if a file is not found... |
|
Back to top |
|
|
HenriqueS
New User
Joined: 17 Feb 2007 Posts: 30 Location: Brazil
|
|
|
|
Folks, according to IBM support, there is a bug on the Java Record IO lib, not allowing to access DDNAMES. This affects JDK 1.4, 1.5 and 1.6. There is already an open PMR and APAR specific to JDK 1.4. Soon I will post more details.
PMR: 71125,072,649
APAR: PK82291 - JAVA142 SR12 PROBLEM READING DD/PARMS |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Thank you for the info
d |
|
Back to top |
|
|
|