IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to check whether a file is empty or not thru JCL


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Wed Jan 17, 2007 5:31 pm
Reply with quote

Hi,

1. There is a PGM "PGM1" which write to an output file "OUT.FILE".

2. How can I check using JCL whether the file "OUT.FILE" is empty or not before executing the program ?

Thanks & Regards,

Ranjit Bhingare
Back to top
View user's profile Send private message
harish_mf

New User


Joined: 31 Jul 2005
Posts: 18
Location: bangalore

PostPosted: Wed Jan 17, 2007 5:53 pm
Reply with quote

hi,

by IEBCOMP, or give it for print it gives the return code=4.
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Wed Jan 17, 2007 7:37 pm
Reply with quote

Please use below JCL

//STEP01R EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//IN1 DD DSN=Give your input file,DISP=SHR
//OUT1 DD DUMMY,
// DCB=(RECFM=VB,LRECL=2356)
//SYSIN DD *
REPRO INFILE(IN1) OUTFILE(OUT1) COUNT(1)
/*
//*
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 17, 2007 10:23 pm
Reply with quote

Hello,

What will you do if there IS data in the file? Should PGM1 perform differently based on whether the file has data or is empty?

Do you want to write over any data already in the file?

Do you want to append new data to data already in the file?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top