Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Delete file in one step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
psriv20
Currently Banned

New User


Joined: 25 May 2009
Posts: 19
Location: Pune

PostPosted: Mon Aug 31, 2009 10:53 am    Post subject: Delete file in one step
Reply with quote

Hi,

Can we take the backup and delete the source file in single step?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Aug 31, 2009 10:55 am    Post subject: Reply to: Delete file in one step
Reply with quote

yes...
see the dfdss/adrdssu manuals
Back to top
View user's profile Send private message
psriv20
Currently Banned

New User


Joined: 25 May 2009
Posts: 19
Location: Pune

PostPosted: Mon Aug 31, 2009 10:57 am    Post subject:
Reply with quote

Please explain me ??If possible provide me code also.

I have one flat file and i have to take the bakup from this file and then delete it.All activities should happened in single step.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Aug 31, 2009 11:07 am    Post subject: Reply to: Delete file in one step
Reply with quote

Quote:
Please explain me ??If possible provide me code also.
I have one flat file and i have to take the bakup from this file and then delete it.All activities should happened in single step.


what is there to explain ...
this is a help forum, not a do it for me one
You already told the requirement in the first post, the dataset organization is irrelevant to the issue.
flat file is not a zOS term,
the proper terms are ( usually )
PS Physical Sequential - dasd or tape
PO Partitioned Organization (PDS/PDSE) - dasd only
VSAM Virtual Storage Access Method (KSDS,ESDS,RRDS,LDS) - dasd only

learn to read the manual
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2S261/CCONTENTS?SHELF=DGT2BK70&DN=SC26-7402-09&DT=20080128160125

and here is a thread on dfdss filtering
http://www.ibmmainframes.com/viewtopic.php?t=29913&highlight=adrdssu
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Mon Aug 31, 2009 6:09 pm    Post subject:
Reply with quote

Quote:
If possible provide me code also.
What did you try by your own?
Back to top
View user's profile Send private message
psriv20
Currently Banned

New User


Joined: 25 May 2009
Posts: 19
Location: Pune

PostPosted: Mon Aug 31, 2009 7:12 pm    Post subject:
Reply with quote

I can do it in two step but unable to do in single step.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Aug 31, 2009 7:17 pm    Post subject:
Reply with quote

Did you read the 2nd topic that Enrico provided you a link to ? If you did, you would have found a good example of the JCL required to do this

Click HERE to RTFM on how to use the control statements.

When you have problems AFTER you have tried using DFdss (PGM=ADRDSSU), please let us know and we will try to help.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Tue Sep 01, 2009 1:50 am    Post subject:
Reply with quote

Why can't a simple DISP=(OLD,DELETE,KEEP) be used for the input file?
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Wed Jan 06, 2010 8:45 pm    Post subject:
Reply with quote

//DSSDUMP EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//TAPE1 DD DSN=BACKUP.NAME,DISP=(,CATLG),
// SPACE=(CYL,(750,750),RLSE),VOL=(,,,59)
//SYSIN DD *
DUMP ODD(TAPE1) ALLE ALLD(*) COM OPT(4) SPHERE DELETE PURGE -
DS(INC( -
DSNAME.ONE -
DSNAME.TWO -
etc....
))
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Jan 07, 2010 8:25 pm    Post subject:
Reply with quote

Hello,

Where is the "backup" to be written (which media)? It the backup is also a dasd file, you might consider simply renaming the file. . .
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Fri Jan 08, 2010 6:50 am    Post subject:
Reply with quote

psriv20 might be long gone by now, but why was ADRDSSU suggested? Why wasn't my question of Aug 31 not answered? icon_question.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Jan 08, 2010 12:57 pm    Post subject: Reply to: Delete file in one step
Reply with quote

Hi Terry!
because the original question was ....
Quote:
Can we take the backup and delete the source file in single step?
icon_wink.gif
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Fri Jan 08, 2010 2:38 pm    Post subject:
Reply with quote

Terry's idea is a sensible one too. The problem with DFDSS is it won't pick up the file if it's migrated by DFHSM or equivalent product.

The following illustrates Terry's idea, assuming the file is not VSAM. The presence of the DD's means the source file would be recalled from DFHSM if it was migrated.

//COPY EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//IN DD DSN=SOURCE.NAME,DISP=(OLD,DELETE,KEEP)
//OUT DD DSN=BACKUP.NAME,DISP=(,CATLG),
// LIKE=SOURCE.NAME
//SYSIN DD *
REPRO IFILE(IN) OFILE(OUT)
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Jan 08, 2010 2:45 pm    Post subject: Reply to: Delete file in one step
Reply with quote

Yep,
but we are just speculating , the original question was quite clear,
my/our hope is that the people asking are aware of the environment in which they want things to happen(*)
- but 99% of the time my/our hopes are shattered

(*) if a backup is needed then...
if a dataset is under automated management the whole topic should be canceled
or the management policy reviewed ( to take the proper backups)

if the dataset has been migrated without a backup there must be reasons
which I do not want to investigate
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jan 08, 2010 3:29 pm    Post subject:
Reply with quote

Hi,

personally I'm against using DISP=(OLD,DELETE,KEEP) to backup a file, some utlities such as IDCAMS, IEBGENER etc are very dangerous, an incorrect or missing DDNAME such as SYSPRINT will result in a RC greater than 0, thus blowing away the dataset without copying it.

I would rather delete the file in a second step ie if backup step is successful then delete it.

But then we have this one step mentality which I can never understand.


Gerry
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Fri Jan 08, 2010 7:13 pm    Post subject:
Reply with quote

Quote:
But then we have this one step mentality which I can never understand.

Agree. Better to spend a little extra time or additional steps and be safe than sorry.
enrico, what did you do? Ban yourself? icon_lol.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Sun Jan 10, 2010 4:00 pm    Post subject:
Reply with quote

gcicchet wrote:
But then we have this one step mentality which I can never understand.


Hi Gerry,

it has to do with efficiency. E.g. OPC will work faster processing 1 step jobs, in case of JCL errors with a job stream of e.g. 25 steps its much more difficult to solve jcl errors, program abends if temporary datasets are used. So catalogued datsets are used and deleted at run end.
Beside that JESx is processing 1 step jobs more efficient.
But mostly it has to do with easier job restarts.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Jan 11, 2010 3:07 am    Post subject:
Reply with quote

Hello,

Quote:
But mostly it has to do with easier job restarts.
I believe not. . . I believe this has more to do with people who are lazy and/or are only marginally competent.

If there is any serious perfomance implication due to OPC processing, i suspect the system is in terrible condition.

Quote:
in case of JCL errors with a job stream of e.g. 25 steps its much more difficult to solve jcl errors,
Sorry, but this makes no sense. There is no good reason for a production job to fail with a jcl error. There should be no complex restart issues. Done properly, jcl can be restarted from the beginning with little or from the abended step with no extra work.

As i mentioned, these situations come up because the "stuff" turned over is incorrect or incomlete or done by people who cannot or will not do decent work. More ana more clueless managers compound this as well.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us