IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to find a job list whether the file is Empty or not?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 110
Location: india

PostPosted: Fri Aug 13, 2010 6:03 pm
Reply with quote

My requirement:
I have a lot of jobs/programs in my application.
i need to identify the list of jobs/cobol programs that cann't process empty file if received at any time. How to findout or search? can we search through any keyword in the jobs/programs?
Once After getting the list of jobs/programs, then how to fix it without abending.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 13, 2010 6:17 pm
Reply with quote

Jobs don't process files -- jobs just run programs. Programs may or may not handle empty files. You can find out by code inspection (that is, manually looking at the code), or by the pragmatic approach of running an empty file through the program and see what happens. As far as I am aware, there is no key word to search to determine this as it is entirely and totally dependent upon the program logic.

As far as fixing it goes, you change the code to make it do whatever you want.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 13, 2010 6:18 pm
Reply with quote

??
when you mean empty file, do you mean allocated but not open and closed
or open and closed with no records.
those are two different things.

test everything under both circumstances?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 13, 2010 9:11 pm
Reply with quote

Hello,

There is much testing to be done. . .

Once the "empty file test" test has been done for a program, the code may need to be modified to handle the empty file(s). Seems like one of 3 results might happen:
1. Code works properly.
2. Code abends.
3. Code executes, but does not properly handle the empty file(s).

2 & 3 require code modification - there is no generic solution. Proper "empty file" information needs to be added to the code and a return-code set or a User Abend issued.

And then the modified code must be promoted to Production.
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Sat Aug 14, 2010 10:22 am
Reply with quote

One more thing to add,
When you get an empty file and when first read is EOF in your program, then you can set RETURN-CODE to 02 or 03 (which is not system generated) in cobol program and then the downstream step will run based on your business logic (you want to run or no). This according to me will help the support guy.
Back to top
View user's profile Send private message
santy
Warnings : 1

New User


Joined: 19 Jul 2007
Posts: 22
Location: mumbai

PostPosted: Tue Aug 17, 2010 10:45 am
Reply with quote

to check an empty file in your program, u have to use an logic to do that each time whenever you get an file.

once u get an file then check the file is empty or not.
Read the file.
IF first read is EOF
then file is empty
Else
file is not empty.
do your rest of program.
End-if.


this logic will run every time whenever you open a new file.

Hope this logic will help you as solution for ur query.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top