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

Delete file in one step


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Aug 31, 2009 10:55 am
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Aug 31, 2009 11:07 am
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
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
www.ibmmainframes.com/viewtopic.php?t=29913&highlight=adrdssu
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Mon Aug 31, 2009 6:09 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Mon Aug 31, 2009 7:17 pm
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: 1249
Location: Richfield, MN, USA

PostPosted: Tue Sep 01, 2009 1:50 am
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 Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Wed Jan 06, 2010 8:45 pm
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

Moderator Emeritus


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

PostPosted: Thu Jan 07, 2010 8:25 pm
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: 1249
Location: Richfield, MN, USA

PostPosted: Fri Jan 08, 2010 6:50 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Jan 08, 2010 12:57 pm
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 Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Fri Jan 08, 2010 2:38 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Jan 08, 2010 2:45 pm
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: 1702
Location: Australia

PostPosted: Fri Jan 08, 2010 3:29 pm
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: 1249
Location: Richfield, MN, USA

PostPosted: Fri Jan 08, 2010 7:13 pm
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: 2481
Location: Netherlands, Amstelveen

PostPosted: Sun Jan 10, 2010 4:00 pm
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

Moderator Emeritus


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

PostPosted: Mon Jan 11, 2010 3:07 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
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 DELETE SPUFI DB2 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top