View previous topic :: View next topic
|
Author |
Message |
rsangeeth
New User
Joined: 26 Jun 2007 Posts: 7 Location: Chennai
|
|
|
|
Hello All,
Could you please help me here to delete a empty file in a JCL. My requirement is a GDG flat file is created in STEP1 and i want to delete the same if the file is empty without changing the condtion code in the next step STEP2.
I tried to use the IDCAMS to check wheather the file is empty and i can delete it in the next step as i was not able to delete in IDCAMS because i do not know how to instruct the IDCAMS about the latest GDG version. If i delete the file in next step, the job ends with Maxcc 4.
I cannot go with this approach as this will affect the OPC scheduling.
Many thanks in advance for your help.
Thanks,
Sangeeth. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
If you raise a MAXCC=4, then use the following in the same step just after the DELETE -
This should override the MAXCC=4, but give it a try and let us know....
Bill |
|
Back to top |
|
|
rsangeeth
New User
Joined: 26 Jun 2007 Posts: 7 Location: Chennai
|
|
|
|
Hello Bill,
Thanks for the response. I have tried this if it is in the same step i can delete it and it will work fine. I can delete the GDG file in there and i use the same in the next step it doesnt work.
Code: |
PRINT INFILE(IN1) COUNT(1)
IF LASTCC=4 THEN DO
DELETE IN1
SET MAXCC=0
END |
This works perfectly fine when file is a normal flat file. But here i cannot instruct to delete a GDG file.
Sangeeth. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You might consider creating a non-gdg file and then copy this to a new generation when it is not empty. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Also, to avoid any potential security issues, COUNT(0) will work. If the file is empty, the MAXCC will still be 4. This way, there's no hardcopy if the file contained live data and the security folks won't raise a stink....
Bill |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
dick scherrer wrote: |
Hello,
You might consider creating a non-gdg file and then copy this to a new generation when it is not empty. |
Bingo! Do it the right way and avoid the problems completely. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Or even
Code: |
//STEP0010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//FILEOUT DD DSN=&&TESTFILE,DISP=(,DELETE,DELETE),
// SPACE=(TRK,5),RECFM=VB,LRECL=32756
//FILEIN DD DSN=gdg.base(0),DISP=SHR
//SYSIN DD *
REPRO IFILE(FILEIN) OFILE(FILEOUT) COUNT(1)
the rest of your IDCAMS statements |
|
|
Back to top |
|
|
rsangeeth
New User
Joined: 26 Jun 2007 Posts: 7 Location: Chennai
|
|
|
|
Hi All,
Sorry i could not follow the logic described by you. Even if i try to use a flat file instead of a GDG the problem will not be solved i guess. As the final file has to be a GDG. Even if i follow the logic like given below, i am not sure if that will solve the problem. The problem is eiether deleing the gdg file in the idcams or overrding the MAXCC thrown by the JCL.
Code: |
//STEP0010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//FILEOUT DD DSN=&&TESTFILE,DISP=(,DELETE,DELETE),
// SPACE=(TRK,5),RECFM=VB,LRECL=32756
//FILEIN DD DSN=gdg.base(0),DISP=SHR
//SYSIN DD *
REPRO IFILE(FILEIN) OFILE(FILEOUT) COUNT(1)
the rest of your IDCAMS statements
|
Many thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Even if i try to use a flat file instead of a GDG the problem will not be solved i guess. |
You guess wrong. . .
If you do what i suggested, it will do just what you want.
Post the jcl you used to do what i suggested that does not work and the diagnostic information generated and someone will be able to help. |
|
Back to top |
|
|
|