Monday, November 12, 2012

Using ADRDSSU to dump and restore datasets

Wondered if you have the concept of zipping files and transferring them to a different system - available in mainframe domain? Yes, You have a similar concept of dumping datasets to a dump file and use it to store or transfer to a different mainframe system and later restore the dumped datasets. Here is how You can do it.

Dump multiple datasets to a single dump:


//AIWCDMP  JOB  (WA2,,'ADMIN',GM,0085,),                                00010006
//             'JCL MANAGEMENT 10.0',                                   00020000
//             MSGCLASS=V,                                              00030000
//             CLASS=E,                                                 00040000
//             REGION=0M,                                               00050000
//             NOTIFY=&SYSUID                                           00060000
//*MAIN SYSTEM=ANZH                                                     00110009
//*-------------------------------------------------------------------- 00790000
//*  JS010 - DUMP DATASETS TO CTAPE                                   - 00800000
//*                                                                   - 00810000
//*-------------------------------------------------------------------- 00820000
//JS010    EXEC  PGM=ADRDSSU,                                           00840000
//             PARM='SIZE=4096K',                                       00850000
//             TIME=540,                                                00851000
//             COND=(0,NE)                                              00860000
//SYSPRINT DD  SYSOUT=*                                                 00870000
//DUMPDS   DD  DSN=AIW.AIW133.WR5347.DS.BKUP2,                          00880009
//             BLKSIZE=32760,                                           00890000
//             LABEL=(1,SL),                                            00910000
//             DATACLAS=DCBLANK,                                        00920003
//             RETPD=2,                                                 00930001
//             VOL=(,,,20),                                             00940004
//             DISP=(NEW,CATLG,DELETE),                                 00950000
//             UNIT=RTAPE                                               00960000
//SYSIN    DD  *                                                        00970000
  DUMP DATASET(INCLUDE( -                                               00980000
              DAIW.DS.X.TWDL066D                        -               00990009
              DAIW.DS.X.TWDL066O                        -               01000009
              DAIW.DS.X.TWDL072D                        -               01010009
              DAIW.DS.X.TWDL072O                        -               01020009
              DAIW.DS.X.TWDL129D                        -               01030009
              DAIW.DS.X.TWDL129O                        -               01040009
              DAIW.DS.X.TWDS010D                        -               01050009
              DAIW.DS.X.TWDS010O                        -               01060009
              DAIW.DS.X.TWDS014D                        -               01061009
              DAIW.DS.X.TWDS014O                        -               01062009
              DAIW.DS.X.TWGT001D                        -               01063009
              DAIW.DS.X.TWGT001O                        -               01064009
              DAIW.DS.X.TWGT002D                        -               01064109
              DAIW.DS.X.TWGT002O                        -               01064209
              DAIW.DS.X.TWGT003D                        -               01064309
              DAIW.DS.X.TWGT003O                        -               01064409
              DAIW.DS.X.TWIN006D                        -               01064509
              DAIW.DS.X.TWIN006O                        -               01064609
              DAIW.DS.X.TWIN011D                        -               01064709
              DAIW.DS.X.TWIN011O                        -               01064809
              DAIW.DS.X.TWIR002D                        -               01064909
              DAIW.DS.X.TWIR002O                        -               01065009
              DAIW.DS.X.TWLM001D                        -               01065109
              DAIW.DS.X.TWLM001O                        -               01065209
              DAIW.DS.X.TWPD002D                        -               01065309
              DAIW.DS.X.TWPD002O                        -               01065409
              DAIW.DS.X.TWRT060D                        -               01065509
              DAIW.DS.X.TWRT060O                        -               01065609
              DAIW.DS.X.TWSY004D                        -               01065709
              DAIW.DS.X.TWSY004O                        -               01065809
              DAIW.DS.X.TWSY005D                        -               01065909
              DAIW.DS.X.TWSY005O                        -               01066009
              DAIW.DS.X.TWSY006D                        -               01066109
              DAIW.DS.X.TWSY006O                        -               01066209
              DAIW.DS.X.TWSY011D                        -               01066309
              DAIW.DS.X.TWSY011O                        -               01066409
              DAIW.DS.X.TWSY188D                        -               01066509
              DAIW.DS.X.TWSY188O                        -               01066609
                      ))-                                               01066705
       OUTDDNAME(DUMPDS)-                                               01066805
       SHARE -                                                          01066905
       TOLERATE(ENQFAILURE) -                                           01067005
       COMPRESS                                                         01068005
/*                                                                      01070000
//*                                                                     01080000


You can now FTP or simply store the output dump which contains all the listed datasets.

Restore the dumped datasets:


//AIWRDMP  JOB  (WB9,,'CFS INTERNATIONAL',GM,0085,),
//             'JCL MANAGEMENT 10.2',
//             MSGCLASS=V,
//             CLASS=E,
//             REGION=0M,
//             NOTIFY=&SYSUID
//*MAIN SYSTEM=ANZH
//*---------------------------------------------------------------------
//*
//* RETRIEVE THE DATASET MENTIONED IN THE INCLUDE OPTION FROM INPUT
//* TAPEI DATASET
//*
//*---------------------------------------------------------------------
//JS010    EXEC  PGM=ADRDSSU,
//             REGION=0M,TIME=540
//TAPEI   DD  DSN=AIW.AIW133.CDUMP3,
//             VOL=SER=D23554,
//             DISP=SHR
//SYSIN   DD  *
 RESTORE INDDNAME(TAPEI)                -
   DATASET(INCLUDE(                     -
   PAIW.**                          -
   )) -
   RENUNC((PAIW.**,DAIW.**))
/*
//SYSPRINT DD  SYSOUT=*
/*
//
   TOL(ENQF)                             -
   TGTA(SRC)                             -
   SPHERE -
   TGTGDS(ACTIVE)                        -
   CAT



Saturday, November 10, 2012

Shiva Samudram Falls, Karnataka



The Shivanasamudra Waterfalls, literally meaning Shiva's Sea are situated at a distance of 85 kms from Mysore and 139 kms from Bangalore. The route to this segmented falls from bangalore is fantastic and well maintained. The island town of Shivanasamudra divides the river Cauvery into two different falls which display a captivating sight. On the one side, it forms the Gaganachukki falls shaped like a large horsetail and on the other side are the Bharachukki Falls. The sight of these two falls is enchanting.

The Gaganachukki waterfalls are best viewed from the Shivanasamudra watch tower. There is another approach to the Gaganachukki falls from the Darga Hazrath Mardane Gaib. Bharachukki falls are situated at distance of approximately one km from the Dargah. These falls are best during the monsoons, nevertheless their beauty mesmerizes tourists throughout the year.

Shivanasamudra is home to the first Hydro-electric Power station in Asia, which was set up in the year 1902. This station was commissioned by the Diwan of Mysore, Sir K. Seshadri Iyer. This is one of the oldest generating station in India The electricity produced here was initially used in the Kolar Gold Fields. Thus, Kolar Gold Fields became the first town in Asia to get hydro electricity.

Some Guidelines for the visitors:
The best time to visit the Shivasamudram is during the monsoons from June to October. This is the time when the waterfalls are scenically beautiful with the water gushing down in full flow into the deep gorge below.Don't forget to take your bath suits and slippers to have a shower in the base of the falls - Be careful though, it can be dangerous and slippery.You don't get good restaurants and dining facilities near the falls or within 10 km range of it. So make sure You carry our meals boxes with You when You travel.The footsteps to the basin of the fall are steep and its tiresome to climb down the stairs and come back again. Be prepared for a little bit of physical stamina test.


Tuesday, November 6, 2012

SPLICE of ICETOOL - Merge two or more flat files


The Splice operator of ICETOOL is a very useful utility for matching and merging files based on a key. Now lets say we have two files with a common key as shown below:

File 1: 
Y12 89503 MKT
Y12 57301 MKT
Z35 02316 DEV
Y12 91073 MKT
Z35 18693 DEV

File 2:
89503 27M $9,185,354 SAN JOSE CA
72135 08M   $317,632 BOSTON   MA
18693 10M $8,732,105 BUFFALO  NY
57301 50M    $30,000 NEWARK   NJ

Now lets say we want the output file to have the information for a particular key value which consists of data from both the files. Lets say the output file should something like this.

Output:
Y12 89503 MKT 27M $9,185,354 CA
Y12 57301 MKT 50M    $30,000 NJ
Z35 02316 DEV
Y12 91073 MKT
Z35 18693 DEV 10M $8,732,105 NY

We can do this using simple Splice tricks. The point that needs to be noted here is just that both the files should have the key field in the same position. In this process both the files are merged to a single temp file and then the temp file is spliced to created the reformatted records which contains info from both the files.

//SPLCMRGE JOB  (WAR,,'ADMIN',GM,0085,),
//             'JCL MANAGEMENT 10.0',
//             MSGCLASS=V,
//             CLASS=E,
//             REGION=0M,
//             NOTIFY=&SYSUID
//SM01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
Y12 89503 MKT
Y12 57301 MKT
Z35 02316 DEV
Y12 91073 MKT
Z35 18693 DEV
/*
//IN2 DD *
89503 27M $9,185,354 SAN JOSE CA
72135 08M   $317,632 BOSTON   MA
18693 10M $8,732,105 BUFFALO  NY
57301 50M    $30,000 NEWARK   NJ
/*
//TEMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//COMBINE DD SYSOUT=*
//TOOLIN DD *
   COPY FROM(IN1) TO(TEMP1) USING(CTL1)
   COPY FROM(IN2) TO(TEMP1) USING(CTL2)
   SPLICE FROM(TEMP1) TO(COMBINE) ON(5,5,ZD) WITH(15,17)
/*
//CTL1CNTL DD *
   OUTREC FIELDS=(1:1,14,31:X)
/*
//CTL2CNTL DD *
   OUTREC FIELDS=(5:1,5,15:7,15,30:33,2)
/*

You Can use this technique to merge more than two files as well:


//STEP0100 EXEC PGM=ICETOOL                            
//TOOLMSG  DD SYSOUT=*                                
//DFSMSG   DD SYSOUT=*                                
//IN       DD *                                        
1234 Y                                                
1268 Y                                                
1299 Y                                                
1290 Y                                                
1000 Y                                                
//         DD *                                        
1000   Y                                              
1250   Y                                              
1386   Y                                              
1290   Y                                              
//         DD *                                        
1000     Y                                            
1001     Y                                            
1003     Y                                            
//OUT      DD SYSOUT=*                                
//TOOLIN   DD *                                        
  SPLICE FROM(IN) TO(OUT) ON(1,4,CH) WITHEACH -        
  WITH(8,1) WITH(10,1) KEEPNODUPS         
//*

And the output looks like:

1000 Y Y Y 
1001     Y 
1003     Y 
1234 Y    
1250   Y  
1268 Y    
1290 Y Y  
1299 Y    
1386   Y  

Popular

Featured

Three Months of Chadhei