How to find whether a Flat file is empty or not without
Reading a file in COBOL Program. (not using JCL)

Answers were Sorted based on User's Feedback



How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not usin..

Answer / abhijit saha

Without JCL & Cobol i have this Option.
Just Type 'I' in front of your Datset which gives you
Data Set Information
jst Check the Current Utilization part if it shows 0 it
menas file is empty..

Is This Answer Correct ?    10 Yes 2 No

How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not usin..

Answer / sandy

Opening a file will give a file status code of '0' and
not '10'. Only when reading, file status will be '10'

Is This Answer Correct ?    11 Yes 4 No

How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not usin..

Answer / renu

Open the file and check the file code. If it is '10', the file is empty. It is always better to check the file code after every open statement and handle the empty file condition.

Is This Answer Correct ?    10 Yes 8 No

How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not usin..

Answer / sharmila_g

IEBPTPCH is used to check empty dataset.. if it returns 4 the dataset is empty or if it returns 0 it is not empty.

Is This Answer Correct ?    4 Yes 2 No

How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not usin..

Answer / srini

You can do with IDCAMS. Use input as your file and output
is dummy file and have repro count(1) in sysin dd *, if the
file is empty, you will get condition code 4 otherwise you
will get cc '0'.

Is This Answer Correct ?    5 Yes 5 No

How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not usin..

Answer / vinodh

Goto ISPF 3.4, give the dataset name hit enter.
Press F11 until you see '%used', if its zero then the file
is empty. This will be useful if you want to validate many
GDG's for emptiness.

Is This Answer Correct ?    3 Yes 4 No

How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not usin..

Answer / amarnadh reddy

Hi,
Use 3.4 option,to see the flat file. After it display the
file is empty.
or
When the file reading, file status code is 23.

Is This Answer Correct ?    3 Yes 5 No

How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not usin..

Answer / anusha

Hope the dataset browse option (ISPF option) will tell
you 'DATASET is EMPTY' if no records in the file.

Is This Answer Correct ?    3 Yes 8 No

How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not usin..

Answer / sroul4

Just write COUNT in front of the data set it will show thw
record count in it. 0 in this case.

Is This Answer Correct ?    1 Yes 10 No

Post New Answer

More COBOL Interview Questions

COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'

8 Answers   Barclays, IBM,


Discuss about changing dataset name in proc.

0 Answers  


Consider the following code: 77 A PIC 99V99 VALUE 55.35 77 B PIC 99V999 VALUE 32.754 ADD B TO A ON SIZE ERROR DISPLAY "ERROR!!!" What will be the result ? (a) A=88.10, B=32.754 (b) A=87.00 B=32.754 (c) A=87.10 B=32.754 (d) ERROR!!! will be DISPLAYed on the screen.

3 Answers   TCS,


i want to store 20 digits . h will u do it in cobol ?

4 Answers   TCS,


Describe the cobol database components?

0 Answers  


which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

0 Answers  


what is the use of keep and pass in disp

1 Answers  


How can we increase the size of an existing PDS to include more no. of modules. I tried the answer posted by Jagan(TSO PDS 'pds name') but did not find it working. The answer posted by kamal i know very well. Please suggest me a answer so that we don't need to delete the existing PDS and still we can change the size as well.

10 Answers  


What are some examples of command terminators?

1 Answers  


Differentiate between structured cobol programming and object-oriented cobol programming.

0 Answers  


How do you set a return code to the JCL from a COBOL program?

4 Answers  


hw to create 3 dimensional array & hw to access it?

1 Answers  


Categories