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

Searching and deleting a dataset created in the JCL.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vickey_tcs

New User


Joined: 14 Mar 2009
Posts: 5
Location: At Desk

PostPosted: Mon Mar 16, 2009 9:32 pm
Reply with quote

Hi,

For testing purposes i uses many test files.My query is that while testing a JCL for more than 1 time, i first delete the file created in previous test JCL and then run ..this consumes lot of time..Could any one help me the following..

I want to create a tool in REXX/CLIST.eg: when i give tso search..automatically the search tool should find the dataset created in the JCL and delete it..

Please help me on this...
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: Mon Mar 16, 2009 9:38 pm
Reply with quote

Hello,

Suggest you include one single step at the beginning of each test job to "clean house" before running.

This step could be an IEFBR14 that specifies disp=(mod,delete) for each file that may be created by the job so they will not already exist when the attempt is made to create them.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Tue Mar 17, 2009 10:19 am
Reply with quote

I use this step before a step which creates the data set(s).
Code:
//DELST1   EXEC PGM=IDCAMS                                       
//SYSPRINT DD  SYSOUT=*                                           
//SYSIN    DD  *                                                 
     DELETE  data-set-name1 PURGE             
     DELETE  data-set-name2 PURGE           
     IF MAXCC LT 9 THEN SET MAXCC EQ 0                           
                   ELSE SET MAXCC EQ 16                           
/*
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Mar 17, 2009 1:43 pm
Reply with quote

Hi,

By any chance do you have CA-Jobtrac (Scheduler) available to you?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Mar 17, 2009 1:52 pm
Reply with quote

Hi again,

I'm not sure how good to ask this - what if one is supposed to run multiple JCLs for some testing and end-up with lots of "new-files"? Are we supposed code IEFBR14 or IDCAMS for each DSN . . .mmmm..this thought itself is kinda scary - what's the benefit of taking birth in SMS world then?

I never used such methods instead I use UCC11RMS with TYPRUM=F (PARM=F) as first step in each JCL I submit . . . this takes care of what is being asked in this thread.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Tue Mar 17, 2009 2:04 pm
Reply with quote

Quote:
... I use UCC11RMS with TYPRUM=F (PARM=F) ...

I don't have this in developement as well as in testing...

Even I see IDCAMS DELETE for new datasets in production JCLs.

Guess I'm missing something here? icon_sad.gif
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: Tue Mar 17, 2009 8:48 pm
Reply with quote

Hello,

Quote:
Guess I'm missing something here?
Me too . . . icon_confused.gif

I believe that using br14 or idcams is a very simple, completely workable method can be implemented.

Well written jobstreams will delete any unneeded files before ending and this "first" step is merely insurance.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Mar 18, 2009 2:44 pm
Reply with quote

dick scherrer wrote:
Well written jobstreams will delete any unneeded files before ending . . .
Yes if they are "unneeded" they should be deleted. But OP talks about
Quote:
For testing purposes i uses many test files
which I assume are the "natural" & "needed" outcome from the JCL. I believe - in his test runs there are some files, which should be created because they are the expected output files. But as he is testing so in a re-test, when JCL is checked for syntax erros, for such file there is a sytax error that "file is already cataloged" . . .

Does other shop don't have any in-house utilites or some sheduler to deal with these things. On a daily basis, sometimes, I run many many test with many JCLs . . . what if my first run does not yield the expected result, how many files should I delete via BR14 or IDCAMS? Even if I use them, how practical solution is that . . . icon_confused.gif
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Mar 18, 2009 3:47 pm
Reply with quote

Hi Anuj,

Quote:
... instead I use UCC11RMS with TYPRUM=F (PARM=F) as first step in each JCL ...

I guess this is related to CA - Jobtrac. Will this step delete datasets found with DISP as (NEW, ... , ...) in the JCL?

If so, you are DELETEing datasets anyway... So, this DELETE will use what MVS service? possibly IDCAMS DELETE or BR14 with (,DELETE,) as DISP or any other? icon_neutral.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sun Mar 22, 2009 11:58 pm
Reply with quote

Hi,

yes this is to do with CA-7...umm...I would need to visit my friend's shop to understand if this (what is being said in this thread) is the case at other places..I'm quite surprised . . .
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Mar 23, 2009 1:30 am
Reply with quote

Quote:
So, this DELETE will use what MVS service? possibly IDCAMS DELETE or BR14 with (,DELETE,) as DISP or any other?


if You are curious on how to do it ( source code provided ) ...
look at cbt file 183 which among other goodies contains ...
Quote:
CLEANUP Assembler program. Automatically searches the MVS
catalog for non-GDG data sets that will be created
in subsequent steps of your job and deletes them.
HSM-migrated data sets are deleted with HDELETE.

//MYJOB JOB acct#
//*
//CLEANUP EXEC PGM=CLEANUP
//*
//STEP1 EXEC PGM=MYPROG1
//OUTDD DD DSN=MY.FILE1,DISP=(,CATLG)
//STEP2 EXEC PGM=MYPROG2
//OUTDD DD DSN=MY.FILE2,DISP=(,CATLG)

Can also be executed as the LAST step of a job to
delete non-GDG data sets that were created during
job execution.


gsf-soft.com/Freeware/
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Deleting a Tape file JCL & VSAM 14
Search our Forums:

Back to Top