View previous topic :: View next topic
|
Author |
Message |
RanjitRaveendran Warnings : 1 New User
Joined: 24 Nov 2008 Posts: 20 Location: Bangalore
|
|
|
|
I want to override the first 12 characters of a 16 char length field in a VB file whenever it is superceded by something like 'PMT+1:'
For example,
whenever i find characters like 'PMT+1:1+CA:1111222233334444:' (which starts with a common sequence of characters 'PMT+1:' in a VB file, i need to replace the 6th to 17th columns of that string after the 'PMT+1:' with another character 'X'
Input = 'PMT+1:1+CA:1111222233334444'
Expected Output = 'PMT+1:1+CA:XXXXXXXXXXXX4444'
And i need to do this in a GDG file (VB) with 255 generations. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The positions you mention do not agree with your example. First of all, a VB record has an RDW in positions 1-4, so the first data byte starts in position 5, not 1. You say you want to replace the 6th to 17th columns with X but in your example, that is NOT what you're replacing with X.
Please show your input record as it really looks (rrrr for RDW), e.g.
rrrr'PMT+1:1+CA:1111222233334444'
or
rrrrPMT+1:1+CA:1111222233334444
and indicate which positions you want to replace with X. |
|
Back to top |
|
|
RanjitRaveendran Warnings : 1 New User
Joined: 24 Nov 2008 Posts: 20 Location: Bangalore
|
|
|
|
Sorry, i forgot to mention that the string i gave as example is part of a record and does not always appear in a particular position in the whole input record. It varies but the sub-string 'PMT+1:...' follows a constant format. Hence i need to identify from the record the sub-string which would start with a format 'PMT+1:' and then inside the sub-string the starting from 6th to 17th position, i need to override by XXXX. like as in the example i provided earlier. I would like to know if the SORT extends such a facility to identify a string (regardless of where it appears in the record) and then override the following certain numerics at certain positions with 'X'. Below is the actual record where 'PMT+1:' is a sub-string of...
Credit Card Info Removed. . . |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I see the following in your VB record:
'PMT+1:1+CA:1111222233334444
and I believe you want to replace it with:
'PMT+1:1+CA:XXXXXXXXXXXX4444
wherever it's found - right?
Does 1+CA: always follow 'PMT+1:?
If not, can anything be present instead of 1+CA:? Or can only a limited number of strings be present instead of 1+CA? If it's only a limited number of strings, what are they? |
|
Back to top |
|
|
RanjitRaveendran Warnings : 1 New User
Joined: 24 Nov 2008 Posts: 20 Location: Bangalore
|
|
|
|
I see the following in your VB record:
'PMT+1:1+CA:1111222233334444
and I believe you want to replace it with:
'PMT+1:1+CA:XXXXXXXXXXXX4444
wherever it's found - right?---> YES that's right.
Does 1+CA: always follow 'PMT+1 ---> No, it may be 1+VI or 1+AX or someother.
If not, can anything be present instead of 1+CA:? Or can only a limited number of strings be present instead of 1+CA? If it's only a limited number of strings, what are they? ---> PMT+1: would always be followed by limited no of characters. like 'PMT+1:1+VI:' or 'PMT+1:2+AX:' i.e though the alpanumeric values could change, the number of characters which follow would remain the same. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
PMT+1: would always be followed by limited no of characters. like 'PMT+1:1+VI:' or 'PMT+1:2+AX:' i.e though the alpanumeric values could change |
In that case, this can't be done with DFSORT's built-in functions. FINDREP does not allow find and "replace with offset". I'd suggest writing a program or DFSORT exit to do it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Sorry to interrupt, but posting credit card information will cease.
Ranjit,
Do not post this question (or anything similar) again.
We will not be responsible for your complete lack of professionalism. . .
d |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Hmmm ... I didn't notice that. I removed that data. |
|
Back to top |
|
|
|