Sign In

Dz Challenge: Tips and Techniques Got a great tip or technique to share?
z & A > Dz Challenge: Tips and Techniques > Dz Challenge: Tips and Techniques : Please make use of the below tips in your daily work View modes: 
User avatar
Guest
syam - 5/11/2012 12:47:44 AM
   
Dz Challenge: Tips and Techniques : Please make use of the below tips in your daily work
1) Some times u might need to manually recall bulk number of datasets by giving HRECALL many number of times which consumes lots of time. Please use the below tip to get rid of this

TSO HRECALL '<HLQ>.*' NOWAIT

say all my datasets starts with 'NLT0.SYAM.*' then issue a command below

TSO HRECALL 'NLT0.SYAM.*' NOWAIT

if there are GDGs present in the above list, the latest version will be recalled. So if you want to recall all the versions of a particular GDG say NLT0.SYAM.GDG the issue the below command to recall all the versions

TSO HRECALL 'NLT0.SYAM.GDG.*' NOWAIT

Above tip is very useful if you need to recall the bulk datasets,can be test libraries which needs to be recalled often to prevent the permanent loss of them after sepecific number of days which depends on management class definition.

2) If your requirement is like,

For all records with some specific value at a particular position say if XXXXXXXXX starting from 1st position, the values starting from position 11 should be replaced with “YYYYYYY”.

Using sort you can achieve this as shown below

Method 1 :

//STEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
FIELDS=COPY
OUTREC IFTHEN=(WHEN=(1,9,CH,EQ,C'XXXXXXXXX'),
OVERLAY=(11:C'YYYYYYY'))
/*

Method 2 :

//STEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTREC IFTHEN=(WHEN=(1,9,CH,EQ,C'XXXXXXXXX'),
BUILD=(1,10,11: C'YYYYYYY'),18,<Record length>))
/*


3) Usually we will replace the change the contents in the dataset by going into the edit mode of dataset using c all 'XXXXXXXXX' 'YYYYYYYYY'

If your requirement is to include this as a step in the job then use the below

//STEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTREC FINDREP=(IN=C’XXXXXXXXX',OUT=C’YYYYYYYYY')
/*

4) Do you know that while loading data into any table, the table goes to unavailable state for the other applications which is so called technically downtime, To prevent this use CLONES concept in DB2.

Replace data in a table no outage. CLONEs effectively provide LOAD REPLACE SHRLEVEL CHANGE.

You can use normal LOAD SHRLEVEL CHANGE RESUME option but you need to clear the data in the table before doing this because you used a resume option in the load card

***************************************************
I hope this can help u alot in your daily work. Please make use of the above tips and kindly let us know your feedback to Destination Z & me.

Thanks,
Syam

User avatar
Member
Member
Khan - 5/14/2012 10:12:29 AM
   
RE:Dz Challenge: Tips and Techniques : Please make use of the below tips in your daily work
Fisrt tip is a good one..very usefulll

1