Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

JCL for backing up non-empty files

JCL for backing up non-empty files

JCL for backing up non-empty files

I have some JCL that used IDCAMS to make backups of ASCII load files. Is there a way for the JCL to test the file and skip making a back up if the file is empty?

RE: JCL for backing up non-empty files

I've been off the mainframe for almost ten years but if you do a copy like IDCAMS, IEBGENER, or something like that they return a value if the file is empty.  One of those utilities and using CONDCODE checking you could check to run the copy or not.  

RE: JCL for backing up non-empty files


Are you looking for something like this?


//FCHK1    IF (STEP01.RC = 0) THEN


RE: JCL for backing up non-empty files

How does this relate to COBOL?

One way to do what you want is to set up the JCL to have 2 steps per file.

The first step determines if the file is empty and sets the Return Code (COND CODE). This does not need to read the entire file. . .

The second step executes conditionally and copies the file to wherever it needs to go.

What is an "ascii load file"?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close