View previous topic :: View next topic
|
Author |
Message |
sanjayis01 Warnings : 1 New User
Joined: 13 Jun 2007 Posts: 55 Location: banaglore
|
|
|
|
Hi All
I need to check whether the file is empty or not
I have 2 files called File-1 and File-2 having record length of 81
In step1 - File-1 will be appended with the character 'K' at the 82 position
In Step2- File-2 will be appended with the character 'T' at the 82 position
In Step3 - Both the File-1 and File-2 merged using same DD name
For example : DDname DD DSN=File1,Disp=shr
DD DSN=File2,Disp=shr
Now my criteria is to check wether the file is empty or not
1) how to check if the both the files(o/p file from 3rd step i.emerged file) are empty.
2) How to check if FILE-1 is empty
3) how to check if File-2 is empty
Please let me know if you need more information |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
EXECIO 1 DISKR ddname ( STEM REC. FINIS
if rec.0 = 0 then .... the dataset was empty..
But You have to be sure that the dataset has been written to
even if only to write the EOF |
|
Back to top |
|
|
sanjayis01 Warnings : 1 New User
Joined: 13 Jun 2007 Posts: 55 Location: banaglore
|
|
|
|
hi enrico
could you please explain it (EXECIO 1 DISKR ddname ( STEM REC. FINIS)
i am not familiar with this.
I need it using cobol.
Thanks for reply |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I think this same topic was just discussed here. |
|
Back to top |
|
|
venktv
New User
Joined: 29 Mar 2006 Posts: 59 Location: Montreal
|
|
|
|
Hi..
Read the file once in your COBOL prog, and check condition AT END, if the file is empty the condition will satisfied at first read, and u can take the appropriate decision.
READ file-name INTO rec-name
AT END imperative stat.
Thanks
Venkat |
|
Back to top |
|
|
|