Recommendation Info About How To Check Empty File In Jcl
You can do this by using cond parameter.
How to check empty file in jcl. How i could code a job to check to see if a file exists. If it does, i want to copy it to a new file. Which we can make use to check whether a file is empty.
There may be scenarios where you wish to check if a file is empty or not. //jobcard //stepname exec pgm=idcams //dd1 dd dsn=xxx.pds,disp=shr //sysin dd * print infile(dd1) count(1) /* here the job will give a. Introduce a idcam step to check the file, if it empty then idcam step will return 4.
How to check whether a file is empty or not thru jcl. Icetool sets rc=8 (because the rc8 operand is specified) if the in data set is empty, or rc=0 if the in data set is not empty. There is a pgm pgm1 which write to an output file out.file.
Based on that you can bypass your step no 3. I tried to use the same jcl to print a sequential dataset and my job ran fine. By using idcams utility we can check whether.
Print file is empty # the first. A program must open and read. Count from(indd) empty /* if the file is empty , it will set rc=12 with idcams //indd dd dsn=input file,disp=shr //outdd dd dsn=output file,disp=shr //sysin dd * repro infile(indd).
My_file.seek(0) # ensure you're at the start of the file. Here are some of the commonly used methods to check whether a physical sequential (ps) or vsam file is empty or not. To empty a file in jcl you can use iebgener;