Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Any SORT job to mask a specific field in an input file?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Karthigaiselvan

New User


Joined: 11 Dec 2006
Posts: 35
Location: India

PostPosted: Mon Nov 05, 2007 3:01 pm    Post subject: Any SORT job to mask a specific field in an input file?
Reply with quote

Hi,

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.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Mon Nov 05, 2007 3:23 pm    Post subject: Reply to: Any SORT job to mask a specific field in an input
Reply with quote

For this task a 2 step approach is used...
- remember You cannot have an inline data in a PROC (no sysin dd *)

the first step is a iebgener step copying the sysin data to a temporary dataset

the 2...n steps will invoke the inline procedure as many times needed

here is a sketch

Code:
//*34567890123456789012345678901234567890
//anyname  JOB ....
//* inline proc doing somethig
//procnam PROC GEN= 
//step    EXEC PGM=program_name
//...       DD ...
//CARDS     DD disp=(OLD,PASS),DSN=&&CARDS
//...       DD ...
//GDGDD     DD DISP=....
//             DSN=gdgname(&GEN)
//        PEND
//* first step priming the cards dataset
//PRIME   EXEC PGM=IEBGENER
//SYSIN     DD DUMMY
//SYSPRINT  DD SYSOUT=*
//SYSUT1    DD *
...
... YOUR DATA
...
//SYSUT2    DD DISP=(NEW,PASS),DSN=&&CARDS,
//             .....
//* and here is the rest
//         EXEC procnam,GDG='0'
//         EXEC procnam,GDG='-1'
//         EXEC procnam,GDG='-2'
.....
.....
//         EXEC procnam,GDG='-n'
Back to top
View user's profile Send private message
Karthigaiselvan

New User


Joined: 11 Dec 2006
Posts: 35
Location: India

PostPosted: Tue Nov 06, 2007 8:04 pm    Post subject: Reply to: Any SORT job to mask a specific field in an input
Reply with quote

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?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 670
Location: Pennsylvania

PostPosted: Tue Apr 19, 2011 11:07 pm    Post subject:
Reply with quote

Is this the record?

Ten unrecognisable words in one sentence!
Back to top
View user's profile Send private message
yuvrajdutta

New User


Joined: 13 Jul 2009
Posts: 40
Location: India

PostPosted: Wed Apr 20, 2011 9:42 pm    Post subject: Reply to: Any SORT job to mask a specific field in an input
Reply with quote

I had a requirement once where I had to NFTP around 100 files and I had employed the below DFSORT JOB to accomplish it..

In your case you would have to build an OVERLAY instead of a NFTP JOB for each file:

Code:

//SORTSTEP EXEC PGM=ICEMAN                                           
//SYSPRINT DD SYSOUT=*                                               
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
A.B.C.D
E.F.G.H
I.J.K.L
M.N.O.P
//SORTOUT  DD SYSOUT=(A,INTRDR)                                     
//SYSIN    DD *                                                     
  SORT FIELDS=(1,30,CH,A)                                           
  OUTFIL FNAMES=SORTOUT,REMOVECC,                                   
  BUILD=(C'//NFTP',16,2,C'  JOB (1111),''FTP'',',/,                 
         C'//         REGION=0M,NOTIFY=&SYSUID,MSGCLASS=X,CLASS=A',/,
         C'//STEP001  EXEC PGM=DVGIFBI',/,                     
         C'//DVGLOG  DD  SYSOUT=*',/,                           
         C'//SYSIN   DD  *',/,                                 
         C'FUNCTION=ADD ',/,                                   
         C'XMODE=TO ',/,                                       
         C'CLASS=A ',/,                                         
         C'PRIORITY=0 ',/,                                     
         C'WAIT=YES ',/,                                       
         C'WAITTIME=10 ',/,                                     
         C'RMTCHECK = YES ',/,                                 
         C'RMTNODE=REMOTENODE ',/,                               
         C'SSECURP=(''USERID',''PASSWORD'') ',/,             
         C'RSECURP=(''USERID'',''PASSWORD'') ',/,             
         C'SFILEORG=PS ',/,                                     
         C'RSTATOPT=MAYEXIST ',/,                               
         C'SFILEID=''A.B.PARTOFC',16,2,C'PARTOFC.D''',/,   
         C'RFILEID=''W.X.PARTOFY',16,2,C'PARTOFY.Z''',80:X)


Here part of the 3rd qualifier was the variable entity and all the input file names were of 30 characters
Back to top
View user's profile Send private message
yuvrajdutta

New User


Joined: 13 Jul 2009
Posts: 40
Location: India

PostPosted: Wed Apr 20, 2011 9:45 pm    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Apr 21, 2011 11:33 am    Post subject:
Reply with quote

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.

Garry.
Back to top
View user's profile Send private message
yuvrajdutta

New User


Joined: 13 Jul 2009
Posts: 40
Location: India

PostPosted: Thu Apr 21, 2011 12:19 pm    Post subject:
Reply with quote

Garry,

Wouldn't JES queue position decide which job will execute first..(queue position assignment happens in the order in which job's get assigned to JES.

Correct me if I am wrong.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Apr 21, 2011 12:33 pm    Post subject:
Reply with quote

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.

Garry.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us