My requirement - I've a GDG file with limit of 200 generations. Now i need to mask the value of a particular field (byte position 1-23) with stars (*) in all the generations. Please note that the file names should not be altered meaning we can not create a new set of files with masked data.
For example (Record Length can be assumed as 80)
A sample record in an input file
11111111111111111 cds
The same file should be updated as below
***************** cds
If the number of files is very less, we can sumbit the job as many times as the file count. But since the file count is huge (200). Is there a possibility to submit one SORT job which will do the above masking?
It is also okay to me if by putting the list of all generation file names in a PDS member & input the same to the job which does the masking. The job can read one by one and can mask the data in the file. Let me know of any tricks.
I could achieve the solution by dynamically generating an ICETOOL job and submit to internal reader INTRDR by inputting the list of file names to be edited in a PDS member. Thanks for all your replies. Below is my job.
Code:
//* THIS JOB IS TO A GENERATE JCL TO SUBMIT TO INTERNAL READER
//*
//* FUNCTION OF GENERATED JCL -
//* TO MASK OUT A SPECIFIC FIELD IN THE FILES PASSED IN A PDS
//* TMS352.Z.DYLSORT(FILELIST).
//*
//* STEPS EXPLANATION -
//* THERE ARE 5 STEPS IN THIS JOB. EACH STEP WILL CREATE A
//* PORTION OF JCL TO BE GENERATED. THE GENERATED JCL USES
//* ICETOOL TO MASK THE FIELD.
//*
//* GENSTEP1 -> TO BUILD "EXEC PGM" STEPS FOR THE ICETOOL.
//* GENSTEP2 -> TO BUILD "DD DSN" STEPS FOR INPUT FILES.
//* GENSTEP3 -> TO BUILD "DD DSN" STEPS FOR OUTPUT FILES.
//* GENSTEP4 -> TO BUILD "TOOLIN" STEPS FOR ICETOOL.
//* GENSTEP5 -> TO MERGE PORTIONS CREATED IN LAST 4 STEPS &
//* SUBMIT THE JCL TO INTERNAL READER.
//***************************************************************
//*
//GENSTEP1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DATA,DLM=$$
//TMS352DM JOB (T0133DG),'MASK FIELD',CLASS=3,MSGCLASS=X,
// NOTIFY=&SYSUID
//MASKSTEP EXEC PGM=ICETOOL
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
$$
//SORTOUT DD DSN=&T1,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
/*
//*
//GENSTEP2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TMS352.Z.DYLSORT(FILELIST),DISP=SHR
//TEMP DD DSN=&T1,DISP=(MOD,PASS)
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1,19,21:SEQNUM,3,ZD)
OUTFIL FNAMES=TEMP,
OUTREC=(C'//IN',21,3,C' DD DISP=SHR,DSN=',1,19,37X)
/*
//*
//GENSTEP3 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TMS352.Z.DYLSORT(FILELIST),DISP=SHR
//TEMP DD DSN=&T1,DISP=(MOD,PASS)
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1,19,21:SEQNUM,3,ZD,START=1)
OUTFIL FNAMES=TEMP,
OUTREC=(C'//OUT',21,3,C' DD DISP=SHR,DSN=',1,19,36X)
/*
//*
//GENSTEP4 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DATA,DLM=$$
//TOOLIN DD *
SORT FROM(IN001) TO(OUT001) USING(CTL1)
SORT FROM(IN002) TO(OUT002) USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,5,6:C'******',12,69)
/*
//*
$$
//SORTOUT DD DSN=&T1,DISP=(MOD,PASS)
//SYSIN DD *
OPTION COPY
/*
//*
//GENSTEP5 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&T1,DISP=(OLD,PASS)
//SORTOUT DD SYSOUT=(A,INTRDR)
//SYSIN DD *
OPTION COPY
/*
//*
However, i'm still looking at an optimal solution. What i am looking at is to have one job with one step where we give the base GDG as input/output and it masks the required field in all the generations with out altering the file names. Any tricks?
Also this would submit as many jobs(parallel processing) as the number of SORTIN entries with the VARIABLE portion of the DSNAME appended to the word NFTP as the JOBNAME.. otherwise you can remove the 16,2 portion which will submit several jobs with the same JOBNAME and they will proceed sequentially
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
Quote:
submit several jobs with the same JOBNAME and they will proceed sequentially
While the jobs withthe e the same name will run one-by-one, there is no guarantee as to the sequence in which they will run. With multiple initiators assigned to a job-class, JES may randomly select the next to execute. This has been discussed previously.
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
Yuvraj,
No. This has been discussed several times previously. The only way to ensure jobs run in a given sequence is to submit each as the previous one completes.
I had been under this misapprehension before but, after discussion in these fora, managed to see jobs I submitted with the same jobname run out-of-sequence.