View previous topic :: View next topic
|
Author |
Message |
simmimahajan
New User
Joined: 27 Mar 2007 Posts: 30 Location: USA
|
|
|
|
Hello,
I have a requirement wherein I would have a file which will contain FirstName, LastName, and other such fields. Consider FName = Brena
LName = Lori
I need to do the following:
1. Swap FName and LName
O/p Should be FName = LORI, LName = BRENA
2. Split the FName & LName by getting the midpoint and reverse again as follows
FNAME
'LORI' Split = Char(Length of FName/2) = Output will be O
'LORI' Reverse = OLIR --> Final output of Step 2
LNAME
'Brena' Split = Char(Length of NName/2) = Output will be 'E'
'BRENA Reverse' = RBEAN --> Final output of Step 2
3. Reverse the output of Step 2
FName = RILO
LName = NAEBR
May I know how can I achieve this through SORT.
Also is there some other faster and easier way to achieve this other than SORT?
We may have to do this for millions of records, hence performance is also a criteria.
Looking forward for some positive reply.
Thanks! |
|
Back to top |
|
|
simmimahajan
New User
Joined: 27 Mar 2007 Posts: 30 Location: USA
|
|
|
|
Hello Again,
In the earlier post I did not specify the exact objective of doing this. Basically we are trying to scramble the String. But we need to ensure that any logic provided should be irreversible.
Hence we were working on different options like SQL using DB2, Sort OR Cobol/ Rexx Program. Ideally we want to achieve this at database level but doing this through DB2 would hit the performance drastically hence we have rejected this option. Also I got to know it is not advisable to use SORT on the String as it works more better for Packed Decimals and Numbers.
If anybody can suggest me some better alogrithm to scramble strings which will not affect the 1)Performance, 2)Is irreversible, 3) is not very simple & which can even work for Oracle and Sql Server. I understand this forum is just for Mainframes but we are looking for an aproach will can be global and can be applied irrespective of System in question but at the same time we are looking for the solution in Mainframes.
Thanks Again! Please feel free to provide your inputs on the same. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
If anybody can suggest me some better alogrithm to scramble strings which will not affect the 1)Performance, 2)Is irreversible, 3) is not very simple & which can even work for Oracle and Sql Server. I understand this forum is just for Mainframes but we are looking for an aproach will can be global and can be applied irrespective of System in question but at the same time we are looking for the solution in Mainframes. |
You need to decide which of these goals are most important, since "not very simple" conflicts with "not affect the (p)erformance". What you're looking for is asynchronous encryption, such as PGP. But unless you're very skilled already in encryption coding, be prepared to spend some money for a product to do the encryption. |
|
Back to top |
|
|
simmimahajan
New User
Joined: 27 Mar 2007 Posts: 30 Location: USA
|
|
|
|
I understand there is a trade off. But it should be relatively complex, not easily deducible. But performance is important as well coz we may deal with millions of records. Moreover client is not ready to invest in any external products, hence this option is ruled out.
Thanks for the quick reply! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Once encrypted, how would the "new" records be used?
If the data is in some database (Mainframe, UNIX, Win-Based) why does the security rules of that database not provide what you need to secure the data?
Possibly i misunderstand where the data is to be encrypted. . . |
|
Back to top |
|
|
simmimahajan
New User
Joined: 27 Mar 2007 Posts: 30 Location: USA
|
|
|
|
Hello Dick,
Data will be loaded in QA for testing but we need to achieve this scrambling before data is loaded in to QA from actual live production region(i.e. Mainframe Prod to QA Prod database, Sql Prod database to Sql Prod and so on]. Currently we do not have any such process in place, hence this new process.
Hope this answers your queries. Let me know if there is some disconnect. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
we need to achieve this scrambling before data is loaded |
Why?
If the data is srambled before the load, it will likely be useless for processing transactions or other queries?
If the data is load "normally" why would the permissions for the database environment not suffice to protect the data?
There must be something i am missing. . . |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
instead of scrambling with a home grown algorithm which will give very poor statistical uniqueness
why don' t You look into using a checksumming algorithm
just do a little research ( MD5 SHA ... ) just to name a couple |
|
Back to top |
|
|
simmimahajan
New User
Joined: 27 Mar 2007 Posts: 30 Location: USA
|
|
|
|
Hello,
Yes, we are still working on options, but something which can be developed and easily maintained is what we are looking for.
But would like to thank you for your suggestion.
Thanks Again! |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
simmimahajan,
A cobol program can written in less than an hour to do what you want.
1. get the length of the string(fname/lname) using Using Inspect function reverse checking for leading spaces and once you get the length divide it into half and use reference modification to move the desired length
2. Function Reverse lets you reverse the string.
3. Concatenate 2 strings and perform the reverse again |
|
Back to top |
|
|
simmimahajan
New User
Joined: 27 Mar 2007 Posts: 30 Location: USA
|
|
|
|
Thanks Skolusu! We are working on similar approach and may finalize on using Cobol for scrambling.
Thanks Again! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
In my previous reply I had misunderstood Your requirement..
What You are asking for is commonly called data masking/obfuscation
search google with "data obfuscation" and You will get lots of links
as usual, when I answer, I tend to point out the organizational, security, auditing, certification issues
that' s why for sensitive data manipulation I usually advice against home grown algorithm
they seldom pass an audit/security process
for an issue like this one usually Higher management should be involved,
in many countries they bear legal responsibilities for data mishandling and improper diffusion
that' s why a certified approach would be safer
just being picky,
an algorithm which gives as result the same number of bytes as the source
is seldom irreversible |
|
Back to top |
|
|
simmimahajan
New User
Joined: 27 Mar 2007 Posts: 30 Location: USA
|
|
|
|
Thanks Enrico for all your help! We are exploring different possibilities. |
|
Back to top |
|
|
|