Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1061819
  • 博文数量: 106
  • 博客积分: 9093
  • 博客等级: 中将
  • 技术积分: 2770
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-01 17:22
文章分类

全部博文(106)

文章存档

2014年(1)

2012年(29)

2011年(32)

2010年(20)

2008年(24)

分类: 系统运维

2011-10-14 14:51:49

  • GDG Base是否存在

我们可以使用LISTCAT来判断GDG base是不是存在,如果rc的返回值为0就证明此GDG base是存在的。例子如下:

GDG = "c210408.gdg.base"       
X=OUTTRAP(LST.)                
"LISTC ENT('"GDG"')"           
X=OUTTRAP(OFF)                 
if rc <> 0 then                
  say 'gdg not exist'          

还可以在定义GDG base的时候来判断,例子如下:

DDNAME = "'C210408.GDG.BASE'"                        
x = Outtrap(n.)                                      
"def gdg(name("ddname") LIM(3) SCR)"                 
x = Outtrap(Off)                                     
Do i = 1 To n.0                                      
  err = Pos("DUPLICATE DATA SET NAME",n.i)           
  If err <> 0 Then Say "This GDG already exists"       
End                                                  

  • GDG删除

要想删除整个GDG必须先删除他的各个Generation。而后在删除GDG base。例子如下:

GDG = 'C210408.GDG.BASE'                                    
X=OUTTRAP(LST.)                                             
"LISTC ENT('"GDG"')"                                        
X=OUTTRAP(OFF)                                              
Do A = LST.0 TO 1 BY -1                                     
  If Pos('NONVSAM',LST.A) > 0 Then Do                       
    "DELETE '" || STRIP(SUBSTR(LST.A,17,50)) || "' PURGE"   
  End                                                       
End                                                         
"DELETE '" || GDG || "' GDG PURGE"                          
Exit 0                                                      

阅读(1772) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~