Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JCL for backing up non-empty files

Status
Not open for further replies.

weberm

Programmer
Dec 23, 2002
240
0
0
US
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?
 
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.
 

weberm,

Are you looking for something like this?
Code:
//*STEP01      CHECK FOR DATA TO FTP
//*
//STEP01  EXEC PGM=FILECHK4,PARM=16
//SYSOUT   DD  SYSOUT=*
//FILECHK  DD  DSN=PRD1.LVL6.FILENAME.#14,DISP=OLD
//*
//FCHK1    IF (STEP01.RC = 0) THEN
//STEP02  EXEC PGM=FTP,PARM='-v (EXIT '
//SYSMDUMP DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//OUTPUT   DD  SYSOUT=*
//NETRC    DD  DSN=PROD.LVL6.CTLLIB(FT0)
//INPUT    DD  DSN=PROD.LVL6.RPTLIB(FT6)
//*
//FCHKEND1 ENDIF
//*

Randy
 
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"?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top