How to test thru JCL if any file(PS or VSAM) is empty or
not. I do not want to use any COBOL prog or Ezytrieve and
want to do using utility.

Answer Posted / deb

First SORT the input file.
Assume the sorted o/p is in MY.SORT.FILE, then run this step

//CHEKEMTY EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//MYFILE DD DSN=MY.SORT.FILE,DISP=SHR
//SYSIN DD *
PRINT INFILE(MYFILE) CHARACTER COUNT(1)

if the above step returns a RC=4, then the file is
empty

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use DISP=SHR in output file in JCL

946


what is “Cond= even” and “Cond=only”?

737


How can a stopped job be started again?

703


My Question is 1. How to cound no. of records in JCL. Please explain with an example. 2. How to execute only odd steps in JCL? I know EDIT TYPE = Inculde, Step Name = 1,3,5 and COND code for all even step. Anyone knows other than this.

1982


How can the submitting users racf authority be overridden in a job stream?

738






Explain the job statement in jcl?

642


What do you understand by the term notcat 2 – gs?

747


What is the significance of addrspc parameter in exec statement?

724


What is catelog procedure and how many catelog procedure to use in one job?

7435


I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?

705


How to do automated restart when a job abend?

787


Explain how can a stopped job be started again?

634


WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99 VALUE 123.45. PROCEDURE DIVISION. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. compiler : IGYGR1080-S A "VALUE" clause literal was not compatible with the data category o subject data item. The "VALUE" clause was discarded. WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99. PROCEDURE DIVISION. MOVE 123.45 TO W-B. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. 2375

1029


Matching Logic in Jcl not in cobol.Could any one please answer this question

3669


I have many files which i am receiving from client everyday. I have one step for every file to check for empty or not. Here client gives 30 files i need to check for every file for empty or not and i need to perform 30 steps. Can I do it in single step. Dynamically i need to change the File name in my step.

726