Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
java.io.FileNotFoundException - passing file to Java program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
Virendra Shambharkar

New User


Joined: 26 Aug 2015
Posts: 54
Location: India

PostPosted: Mon Feb 26, 2018 11:41 am    Post subject: java.io.FileNotFoundException - passing file to Java program
Reply with quote

Hi,

I am passing a flat file to a Java program as below :-

Code:
//*------------------------------------------------------
//* RUN JAVA PROGRAM TO USE THE SORTED FILE             
//*------------------------------------------------------
//STEP2   EXEC PGM=BPXBATCH,                             
//          PARM='SH java Filepgm1 //DD:INPUT'           
//SYSPRINT DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//STDOUT   DD PATH='/u/user/inp2.stdout',             
//            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),         
//            PATHMODE=SIRWXU                           
//STDERR   DD PATH='/u/user/err2.stdout',             
//            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),         
//            PATHMODE=SIRWXU                           
//STDENV   DD *                                         
PATH=/bin                                               
JAVA_HOME=/u/user                                     
/*                                                       
//INPUT    DD DSN=TEST.SORT.OUT.JAVA,DISP=SHR     


but getting an error "Exception in thread "main" java.io.FileNotFoundException:

Can you please advise how do I get rid of this error.

Thanks in advance.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2091
Location: UK

PostPosted: Mon Feb 26, 2018 5:23 pm    Post subject:
Reply with quote

Assuming that the JCL above is correct then correct your program.
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10516
Location: italy

PostPosted: Mon Feb 26, 2018 7:06 pm    Post subject: Reply to: java.io.FileNotFoundException - passing file to Java program
Reply with quote

You probably have a wrong ddname specified inside Your program
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2016
Location: NY,USA

PostPosted: Mon Feb 26, 2018 9:49 pm    Post subject:
Reply with quote

Quote:
but getting an error "Exception in thread "main" java.io.FileNotFoundException:

There could be many reason to it, it could be access isssue, did you first check it with the team who manages the Java code, they must tell you why you are getting this error? If not, then please do so.
Back to top
View user's profile Send private message
Virendra Shambharkar

New User


Joined: 26 Aug 2015
Posts: 54
Location: India

PostPosted: Tue Feb 27, 2018 3:59 pm    Post subject: Reply to: java.io.FileNotFoundException - passing file to Java program
Reply with quote

Hi,

While reading the file I am using the below syntax

Code:
 public static void main(String-- args) throws Exception {
     File file=new File("//DD:INPUT");                   
     Scanner sc=new Scanner(file);           



Thanks,
Virendra
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10516
Location: italy

PostPosted: Tue Feb 27, 2018 5:29 pm    Post subject: Reply to: java.io.FileNotFoundException - passing file to Java program
Reply with quote

my usual way of debugging this errors
( where the error messages gives no hint at all )

is to find out the behaviour when I KNOW i made one (error )

just change the ddname in the jcl to something else
or just drop the DD statement and see what happens

or ...
Quote:
java.io.FileNotFoundException


some OTHER DDname - but nobody here will be able to tell - is really missing from the JCL
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISPF 3.4 edit of a ps file, disp use... Carrie Da Silva TSO/ISPF 3 Fri Sep 21, 2018 3:01 am
No new posts How to find if segment is read in any... Priyanka AR IMS DB/DC 8 Thu Sep 20, 2018 1:34 pm
No new posts U0437 to execute IMS DC program Vkp321 IMS DB/DC 6 Wed Sep 19, 2018 8:39 pm
No new posts ICETOOL - Finding keys within a file nartcr DFSORT/ICETOOL 10 Mon Sep 17, 2018 6:39 am
No new posts Remove selected duplicate rows from t... hnharish DFSORT/ICETOOL 3 Wed Sep 05, 2018 3:11 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us