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
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Define static linking and dynamic linking.
What is the significance of 'above the line' and 'below the line'?
Explain complete concept of table handling in COBOL with an example?
which one is the best of com and com-3.using of real time ?
What is redefines clause in COBOL?
What divisions, sections and paragraphs are mandatory for a COBOL program?
Can we change the password using ALTER? anyone tried and changed?
what is a load module ?
How to replace the GOTO statement in COBOL without changing the structure of program. e.g. consider following code... I.D. E.D. D.D. P.D. compute C = A + B. GOTO para 100-display. compute D = C - D. GOTO 200-display. some other logic...... ........ GOTO 300-para. ...... ...... GOTO 400-para. Now I want to replacce all GOTO statements without changing the structure and otput of program.
What are the different data types available in COBOL?
What are options have been removed in COBOL 11?
Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?
6 Answers ABC, IBM, Mphasis, Wipro,