Joined: 12 Feb 2009 Posts: 33 Location: Chennai, India
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.
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.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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.