How to handle empty input file



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

How to handle empty input file

Postby mrgnndhmk » Thu Dec 18, 2008 11:04 am

Hi,
I am getting a program ABEND if my sequential file is empty for the easytrieve. I tried to find if I could find the status and found that file status could be checked only for VSAM or ISAM in easytrieve.

But how can I handle empty input for sequential files?

Error: 138 *******A010 INVALID FILE REFERENCE - VELOFIL

Code:
137 JOB INPUT NULL
138 GET VELOFIL
139 IF EOF VELOFIL
140 DISPLAY 'EMPTY INPUT FILE'
141 ELSE
142 DISPLAY FILE-RECORD
143 END-IF

138 *******A010 INVALID FILE REFERENCE - VELOFIL

I cannot modify to have a VSAM file. Can anyone help me handle this situation?

Regards,
Murugs
mrgnndhmk
 
Posts: 1
Joined: Thu Dec 18, 2008 10:58 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to handle empty input file

Postby dick scherrer » Fri Dec 19, 2008 4:09 am

Hello and welcome to the forum,

I cannot modify to have a VSAM file.
You should not need to - sequential files work quite well.

What is your definition of an "empty file"? Unfortunately, there are multiple ways to have a file with zero records, but not be a true empty file. How was this empty file created?

Why have you specified "job input null" followed by the "get"? How is the file defined?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to handle empty input file

Postby sambras » Wed Jan 21, 2009 6:10 pm

Hi,
One way of handling an empty input file is, yo can count the no of records in the input file in the JOB INPUT statement using a counter.Then yo can check for the value of the counter.If the counter value is "0" yo can move a value (2 or 3 or 8..ur wish) to the predefined variable "RETURN-CODE".
Yo can check for this return-code value before moving further and yo can even code a "COND" parameter in the jobstep which will check for the return-code value generated in the previous step.So yo can direct the program accordingly.
Hope this will help...
sambras
 
Posts: 9
Joined: Wed Jan 21, 2009 3:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to handle empty input file

Postby dick scherrer » Thu Jan 22, 2009 1:20 am

Hello,

This will only work if the file is truly an "empty" file (meaning that the file has a valid end-of-file) rather than being merely allocated.

You need to drop the "yo" and "ur". This is neither a chat room nor an instant messenger. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to handle empty input file

Postby Jegan R » Tue Oct 13, 2009 7:48 pm

Hi We are facing S001 abend in Ezytrive.The file is Empty(THE FILE IS GETTING CREATED FROM another SAS program).But when we override with a empty file ( created using 3.2 option) its working fine.

Can you suggest?
Jegan R
 
Posts: 10
Joined: Tue Aug 18, 2009 3:32 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to handle empty input file

Postby dick scherrer » Wed Oct 14, 2009 12:02 am

Hello,

Can you suggest?
Yes, please re-read the previous reply. . .
This will only work if the file is truly an "empty" file (meaning that the file has a valid end-of-file) rather than being merely allocated.
It sounds like the process that created the file did not create a proper end-of-file. . .

The SAS process will need to write an end-of-file or possibly some "dummy" eof record. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to handle empty input file

Postby Jegan R » Wed Oct 14, 2009 12:34 am

Hi Sorry for the wrong info.. Even when we give an empty file (created from 3.2 option), its giving same S001 Abend.
The same code in the prev posts we are following:
JOB INPUT NULL
GET FILEA
IF EOF FILEA
STOP
END-IF
IF NAME NE ' '
WS-FLAG = 'Y'
END-IF
IF WS-FLAG = 'Y'
PUT FILEB FROM FILEA
END-IF

You have already replied for this GET file question. But Could you please give detail explanation?
Whether Ezytrieve can handle Empty file ( whatever be may the LRECL, RECFM,BLKSIZE) if we use both GET FILEA, if EOF FILEA?
When the input file is Empty, what will GET FILEA will do? will it give abend?
Jegan R
 
Posts: 10
Joined: Tue Aug 18, 2009 3:32 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to handle empty input file

Postby dick scherrer » Wed Oct 14, 2009 12:46 am

Hello,

Easytrieve needs an end-of-file. . . Which is caused by opening the file as output and closing it (by whatever process creates the file). A "truly empty file" is not the same as a "merely allocated" file. Allocating space does not guarantee there will be a valid end-of-file.

Whether Ezytrieve can handle Empty file ..... When the input file is Empty, what will GET FILEA will do? will it give abend?
If the file is a valid "empty file" the first read will cause end-of-file. If the file has no end-of-file, an abend is most likely.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to handle empty input file

Postby Jegan R » Wed Oct 14, 2009 12:51 am

Hi ,

Thank you so much.. I got the Meaning..But for S001, in all the posts i can see the cause of abend as:

Due to wrong LRECL, BLKSIZE. Whats Exactly S001? when will S001 COME? only in Easytrieve?
Jegan R
 
Posts: 10
Joined: Tue Aug 18, 2009 3:32 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to handle empty input file

Postby dick scherrer » Wed Oct 14, 2009 1:03 am

Hello,

There are several reasons for a s001-nn abend. . .

These are mentioned in the info for the IEC020I message:
http://publibz.boulder.ibm.com/cgi-bin/ ... a2m781/3.6

An s001 abend is not unique to Easytrieve.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Next

Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post