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

Suppose, file A has 100 records and file B has 500 records. We want to write records common to both A and B into file C and records which are present only in either A or B into another file D. What should be the logic of Cobol program to achieve this?

7 Answers   Bank Of America, Mind Tree,


how do you reference the rrds file formats from cobol programs

0 Answers  


If there are two copybooks which have same variables and we are using both the copybooks in our program. will there be an error and if i move values to the variable which copybook varibales gets the values i move in.

3 Answers   CTS,


why occurs clause not mentioned in 01 level

6 Answers   HCL, NIIT, TCS, Tesco,


hi. This is Ram.i have one doubt.why can't we display comp-3 variables directly? let me answer quickly plez........

1 Answers  






consider two data items 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VLAUE 123.45 after the statement MOVE W-A TO W-B what will be W-B's value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move

5 Answers   TCS,


where do we use dyanamic call ? and where do we use static call pls give any example pls ?

3 Answers   Patni,


Can we call a CICS program from a batch program or viceversa?If so, how?

3 Answers  


What is the significance of 'above the line' and 'below the line'?

2 Answers   Nokia,


01 a pic x(6) value is abcdef 01 b pic x(3) move a to b wht will be the value in b ?

3 Answers   Patni,


How to read a record from bottom of a file which is indexed by 'A'.

4 Answers   Oracle,


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

0 Answers   iNautix,


Categories