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

related to cobol files


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
stly
Warnings : 1

New User


Joined: 25 Jul 2005
Posts: 93

PostPosted: Mon Mar 06, 2006 1:36 pm
Reply with quote

i hav opened a file in input mode which contains zero records ie empty file.do i get any error.if so wat error i may get.


secondly i hav opened a file in ipnput mode n trying to read.but th file is not existing.wat error i may get.
Back to top
View user's profile Send private message
spriya

New User


Joined: 06 Oct 2005
Posts: 42

PostPosted: Mon Mar 06, 2006 2:11 pm
Reply with quote

it simply returns the error msg record was nt found.
corrections r welcome
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Mon Mar 06, 2006 2:25 pm
Reply with quote

Hi,

Quote:
i hav opened a file in input mode which contains zero records ie empty file.do i get any error.if so wat error i may get.


secondly i hav opened a file in ipnput mode n trying to read.but th file is not existing.wat error i may get.


I believe It will be better if you do teh ame and let us know the result....

Regards
Rupesh
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Mon Mar 06, 2006 5:37 pm
Reply with quote

Quote:
i hav opened a file in input mode which contains zero records ie empty file.do i get any error.if so wat error i may get.

OPENING an EMPTY File should not produce any Error, but as its an I/p File, at the time you READ this Empty File it'll place a File Status Code= 10.
Quote:
secondly i hav opened a file in ipnput mode n trying to read.but th file is not existing.wat error i may get.

It'll lead to JCL ERROR in the JOb you are running for that Program.

Regards,
Priyesh.
Back to top
View user's profile Send private message
stly
Warnings : 1

New User


Joined: 25 Jul 2005
Posts: 93

PostPosted: Tue Mar 07, 2006 1:43 pm
Reply with quote

for the second one may i know the error wat v may get
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue Mar 07, 2006 4:39 pm
Reply with quote

Quote:
for the second one may i know the error wat v may get

JCL ERROR- File Not Found.

Regards,
Priyesh.
Back to top
View user's profile Send private message
bharathsb

New User


Joined: 23 Feb 2006
Posts: 3

PostPosted: Wed Mar 08, 2006 11:57 am
Reply with quote

stly wrote:
i hav opened a file in input mode which contains zero records ie empty file.do i get any error.if so wat error i may get.



In the First Case If it is a VSAM file then ERROR Code of 212 (VSAM Open Error) would occur
Back to top
View user's profile Send private message
stly
Warnings : 1

New User


Joined: 25 Jul 2005
Posts: 93

PostPosted: Sat Apr 01, 2006 10:34 am
Reply with quote

thank u buddies
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Sat Apr 01, 2006 5:20 pm
Reply with quote

hy stly,

1. you get an EOF in your file-status
2. this will never run, JCL error

martin9
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Apr 01, 2006 11:24 pm
Reply with quote

Hi Stly,

The ans to 1) depends on what kind of "empty" the file is.

If the file was open and closed properly but no recs were written you get an EOF condition.

If the file was never properly closed and no recs were written you get an error condition. Also if the file was allocated in one step via IEFBR14 or some such and never OPENed for OP and CLOSEd, you get an error condition when attempting to open for IP. Not sure what the status code will be but if you don't use file status the job will abend on OPEN.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top