/**************************** REXX ************************************/ /* (c) Copyright Roger Lacroix 1997 */ /* */ /* Designed, developed and programmed by Roger Lacroix */ /*--------------------------------------------------------------------*/ /* CRGDG - */ /* SYNTAX: CRGDG */ /* */ /* */ /* Required: */ /* - Create a PDS under your userid called SYSIN */ /* - Run the Rexx program FINDGDG */ /* - Save the output of FINDGDG to SYSIN(GDGBASE) */ /* - Run this program */ /* - In the PDS SYSIN you now should have 2 members: */ /* member: GDGSTMT - contains IDCAMS statements to */ /* rebuild the GDGs */ /* member: GDGDEL - contains IDCAMS statements to */ /* delete the GDGs */ /* */ /* */ /*--------------------------------------------------------------------*/ trace o ADDRESS TSO newline.0= 0 delline.0= 0 "ALLOC DD(GDGSYSIN) DATASET(SYSIN(GDGBASE)) SHR REUSE" say "ALLOC RC="rc "ALLOC DD(GDGSTMT) DATASET(SYSIN(GDGSTMT)) SHR REUSE" say "ALLOC RC="rc "ALLOC DD(GDGDEL) DATASET(SYSIN(GDGDEL)) SHR REUSE" say "ALLOC RC="rc "EXECIO * DISKR GDGSYSIN (FINIS STEM SYSIN." say "Execio RC="rc say "Processing a total of "sysin.0" datasets." do i=1 to sysin.0 dsn = Strip(Substr(sysin.i,17,44)) say "Processing dsn="dsn /* X=MSG('OFF') */ X=OUTTRAP("OUTLINE.") "LISTCAT ENT('"dsn"') ALL" X=OUTTRAP(OFF) call Find_GDG_Parameters end ADDRESS TSO "EXECIO * DISKW GDGSTMT (FINIS STEM NEWLINE." say "Execio RC="rc "EXECIO * DISKW GDGDEL (FINIS STEM DELLINE." say "Execio RC="rc "FREE dd(GDGSYSIN GDGstmt GDGdel)" say "Free RC="rc EXIT /* */ Find_GDG_Parameters: prefix = " DEFINE GDG (NAME(" DO j=1 to outline.0 IF POS('LIMIT------',outline.j) <> 0 THEN do limit = strip(substr(outline.j,25,7),L,'-') keyword1 = strip(substr(outline.j,37,13)) keyword2 = strip(substr(outline.j,54,13)) ptr=newline.0 + 1 newline.ptr = prefix""dsn") LIMIT("limit") "keyword1" "keyword2")" delline.ptr = " DELETE "dsn" " newline.0= ptr delline.0= ptr LEAVE END ELSE NOP END RETURN