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

Doubt about deleting the record


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

New User


Joined: 20 Feb 2004
Posts: 57

PostPosted: Thu Feb 26, 2004 3:05 pm
Reply with quote

hi all,
I have doubt about, which states as A record which was created before 2 years of period has to be deleteed from a database table on by checking each and every month? how u will code that JCL? while before deleting I have to take a back up copy of that table?

Can anybody explain about this
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 237
Location: USA

PostPosted: Thu Feb 26, 2004 3:44 pm
Reply with quote

Hello krbabu,

Below is the jcl you may require,
I have not tested it...but it should work

Code:

//UNLOAD EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
  DSN SYSTEM(DSN)
  RUN PROGRAM(DSNTIAUL) PLAN(DSNTIB71) -
  LIB('DSN710.RUNLIB.LOAD')
//*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*
//SYSREC00 DD DSN=DSN8UNLD.SYSREC00,
//            UNIT=SYSDA,SPACE=(32760,(1000,500)),DISP=(,CATLG)
//*
//SYSPUNCH DD DSN=DSN8UNLD.SYSPUNCH,
//            UNIT=SYSDA,SPACE=(800,(15,15)),DISP=(,CATLG),
//            RECFM=FB,LRECL=120,BLKSIZE=1200
//*
//SYSIN DD *
  DSN8710.EMP
//*
//*--------------------------------------------------------------
//DELETESTP EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
  DSN SYSTEM(DSN)
  RUN PROGRAM(DSNTIAUL) PLAN(DSNTIB71) PARMS('SQL') -
  LIB('DSN710.RUNLIB.LOAD')
//*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*
//SYSREC00 DD DSN=DSN8UNLD.SYSREC00,
//            UNIT=SYSDA,SPACE=(32760,(1000,500)),DISP=(,CATLG)
//*
//SYSREC01 DD DSN=DSN8UNLD.SYSREC01,
//            UNIT=SYSDA,SPACE=(32760,(1000,500)),DISP=(,CATLG)
//*
//SYSPUNCH DD DSN=DSN8UNLD.SYSPUNCH,
//            UNIT=SYSDA,SPACE=(800,(15,15)),DISP=(,CATLG)
//            RECFM=FB,LRECL=120,BLKSIZE=1200
//*
//SYSIN DD *
  LOCK TABLE DSN8710.EMP IN EXCLUSIVE MODE;
  DELETE FROM DSN8710.EMP
  WHERE EMPDATE > '2002-02-26'
//*



Hope this helps,

Regards
Mayuresh Tendulkar
Back to top
View user's profile Send private message
krbabu

New User


Joined: 20 Feb 2004
Posts: 57

PostPosted: Thu Feb 26, 2004 3:55 pm
Reply with quote

what is the code to back up a table?
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 237
Location: USA

PostPosted: Thu Feb 26, 2004 4:20 pm
Reply with quote

Hello krbabu,

Review the jcl carefully,
It has 2 steps UNLOAD & DELETESTP

In UNLOAD, the unloaded table is stored in SYSREC00

Hope this helps,

Regards
Mayuresh Tendulkar
Back to top
View user's profile Send private message
krbabu

New User


Joined: 20 Feb 2004
Posts: 57

PostPosted: Thu Feb 26, 2004 4:23 pm
Reply with quote

thank you mayuresh
Back to top
View user's profile Send private message
juneja_saveen

New User


Joined: 17 Jun 2005
Posts: 6

PostPosted: Sun Jun 19, 2005 3:20 pm
Reply with quote

Can you please explain what is DYNAMNBR????


Thanks
Saveen.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sun Jun 19, 2005 6:14 pm
Reply with quote

Look here:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B650/16.6?DT=20040712170508
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To Discard record with 0 entry if Dup... SYNCSORT 7
No new posts To Populate Trailer cnt in the file w... SYNCSORT 1
No new posts Write record twice based on condition... SYNCSORT 7
No new posts Create a specific record/file based o... SYNCSORT 8
No new posts Sort to insert record in an empty file. DFSORT/ICETOOL 5
Search our Forums:


Back to Top