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
 

 

Masking numbers in th file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Masking numbers in th file
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    Post subject:
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 Moderator


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

PostPosted: Thu Sep 15, 2011 11:22 pm    Post subject:
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    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
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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