IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Masking numbers in th file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Thu Sep 15, 2011 7:49 pm
Reply with quote

Hi,

I have an input sequential file with format FB and length 100 as below
Code:
----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
26547871 2135971HAA   RIVER STREET, CALIFORNIA                                    1234567812345678 0
26547871 2135971HAA   RIVER STREET, CALIFORNIA                                    2314 6781 3456 890
26547871 2135971HAA   RIVER STREET, CALIFORNIA                                    1234-6781-4536-780
26547871 2135971HAA   RIVER STREET, CALIFORNIA                                    123 567 123 567 80
26547871 2135971HAA   RIVER STREET, CALIFORNIA                                    123 567      67 80


We've card numbers between 83 to 99 positions (length 17)
I want to,
1. remove non numeric characters (including spaces) in the card no.
2. if the length of the card no is greater than 12 (after removing non numerics), then leave first 4 bytes and last 4 bytes of card no and put X's between them.
3. if the length of the card no is less than 12 (aftr removing non numerics), then leave the card no as-is in the input file.

below should the output
Code:
----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
26547871 2135971HAA   RIVER STREET, CALIFORNIA                                    1234XXXXXXXX5678 0
26547871 2135971HAA   RIVER STREET, CALIFORNIA                                    2314XXXXXXXX5689 0
26547871 2135971HAA   RIVER STREET, CALIFORNIA                                    1234XXXXXXXX3678 0
26547871 2135971HAA   RIVER STREET, CALIFORNIA                                    1235XXXXXXXX5678 0
26547871 2135971HAA   RIVER STREET, CALIFORNIA                                    123 567      67 80


In 5th record, card no should be as-is in input file since the no of numerics is 9 which is less than 12.

I tried suppressing non numerics usig SQZ function.
Code:
INREC OVERLAY=(1:1,82,83,17,SQZ=(SHIFT=LEFT,PREBLANK=C'-'),100:100,1)


But I am not sure how to check the length of the card no after squeezing and masking it if the length is > 12 and to leave the card no if length of non numerics is less than 12.

I tried searching this form for similar kind of post. My luck was bad.
Please help.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Sep 15, 2011 10:09 pm
Reply with quote

Code:

//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=Your Input FB 100 Byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                                 
  INREC IFOUTLEN=100,                                             
  IFTHEN=(WHEN=INIT,OVERLAY=(101:83,17,UFF,M11,LENGTH=17)),       
  IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=101,                         
      IN=(C'2',C'3',C'4',C'5',C'6',C'7',C'8',C'9'),OUT=C'1')),     
  IFTHEN=(WHEN=INIT,OVERLAY=(119:101,1,ZD,ADD,102,1,ZD,ADD,       
                                 103,1,ZD,ADD,104,1,ZD,ADD,       
                                 105,1,ZD,ADD,106,1,ZD,ADD,       
                                 107,1,ZD,ADD,108,1,ZD,ADD,       
                                 109,1,ZD,ADD,110,1,ZD,ADD,       
                                 111,1,ZD,ADD,112,1,ZD,ADD,       
                                 113,1,ZD,ADD,114,1,ZD,ADD,       
                                 115,1,ZD,ADD,116,1,ZD,ADD,       
                                 117,1,ZD,EDIT=(TT))),             
  IFTHEN=(WHEN=(119,2,ZD,GT,12),OVERLAY=(87:8C'X'))               
//*
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Sep 15, 2011 11:22 pm
Reply with quote

Sathish,

Here's a DFSORT job that will do what you want using SQZ. You didn't say what you wanted to do if the number of numerics is equal to 12, so I assumed you wanted to leave those records alone.

Code:

  OPTION COPY                                               
  INREC IFOUTLEN=100,                                       
   IFTHEN=(WHEN=INIT,                                       
     OVERLAY=(101:83,17,SQZ=(SHIFT=LEFT,PREBLANK=C'-'))),   
   IFTHEN=(WHEN=(113,1,CH,NE,C' '),                         
     OVERLAY=(87:8C'X'))                                   
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top