View previous topic :: View next topic
|
Author |
Message |
maxsubrat
Active User
Joined: 27 Feb 2008 Posts: 110 Location: india
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
??
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
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 |
|
|
santy Warnings : 1 New User
Joined: 19 Jul 2007 Posts: 22 Location: mumbai
|
|
|
|
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 |
|
|
|