don' t You think it would have been more intelligent to use a more descriptive title
cheers enrico When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser, so that I am sure that the information requested can be reached with a very small effort
Check it for what? As the others stated, your post lacks almost ALL information needed to answer your question. Data sets can be sequential, partitioned, indexed, direct, VSAM (ESDS, KSDS, RRDS, LDS), on disk or tape, and so forth.
Then try what Frank has suggested, it should, with or without amendments to the example, do what you want.
My worry is that you might mean one thing by "empty" and actually having a different situation. But, if you are unwilling to be accurate, you are now left to find that out for yourself. I hope that you and the system agree on terminology.
JCL, by itself, cannot determine if a dataset is "empty." The term "empty" has several possible meanings.
A sequential dataset
Has no data. A program must open and read the dataset, and report 0 records.
Is on disk and has never been written to. A program must analyze the dataset label. Many times a program will open and then close the dataset, and the label will effectively report the dataset is "empty," but that is not a guarantee.
Has no members. A program must analyze the directory, and report there are no members.
A PDS member has no data. A program must open the member and report it has no data, just like a sequential dataset.
Any other kind of dataset. Here "empty" is basically meaningless.
Do not ever forget that the purpose of JCL is to define an environment for a program.