hi,
I just joined the forum, I have a very strange request
This is what i need to do:
I have data coming only in one column, I need to pull out the data from inside the column like this:
In the last row I finish on FindNext(ACB1), here i need to search for rule name $POUND(ACB1) and bring it to join it right below FINDNEXT(KDEP).
the concept is like this I have a txt file and need to find a way to search for $POUND(AC**)(or it can be $POUND(ACB) OR $POUND(A**) and cut the next four or five rows of data till i hit the next FINDNEXT(ADE) and have it to come back and join below FINDNEXT(ACB1).
Its like we ran out of space below could not attach any more data, we needed to use FINDNEXT(name of the rule) so that we could search for this rule and attach it at later point. So if the rule is prefixed with $POUND, we need to find if it matches the suffix of FINDNEXT and attach the record there
$POUND(PK**)
ABCDES ssfed Record kp
ID(4930**) READ WRITE ACESS
PQ(5490303)
GPW(23232)
PID(kfeas) FINDNEXT(KDEP)
$POUND(KDE)
ABCDES dke Record po
ID(5940**) READ WRITE ACESS
PQ(5493)
GPW(29928)
PID(kdew) FINDNEXT(ACB1)
Thanks, Craig R
Searching the data
Moderators: chulett, rschirm, roy
Welcome aboard. This is the craziest thing I've seen posted. Could you please state your situation another way? I cannot comprehend the steps the logic needs to follow.
I do understand that you have a non-structured file with record start and end markers. What I don't understand is your terminology like "cut the next for or five rows" and "come back and join below".
We'll give you as much help as you need, we just need to understand it first
I do understand that you have a non-structured file with record start and end markers. What I don't understand is your terminology like "cut the next for or five rows" and "come back and join below".
We'll give you as much help as you need, we just need to understand it first
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Data with embedded navigation instructions. Rather old-fashioned technology, but it rang some old bells (used to see this kind of thing with paper tape "files"). Tricky to do with DataStage, which is about flows, and can only really remember one row back. You'd need at least two passes through the data with DataStage, the first re-casting the data into a more useable format.
I agree that a sed or awk script is probably a preferable approach.
I agree that a sed or awk script is probably a preferable approach.
Last edited by ray.wurlod on Sat Jul 22, 2006 6:32 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Is it something like, searching for POUND(A**) and attach the rest of lines till we reach FINDNEXT(**, to the previously found FINDNEXT(***
So that your required output should be
POUND...
..
..
FINDNEXT..
..
..
FINDNEXT...
...
..?????
So that your required output should be
POUND...
..
..
FINDNEXT..
..
..
FINDNEXT...
...
..?????
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What do you need to do with all the intervening lines? Do they become separate columns in a single row? What is the terminating condition for a row? Does each $POUND introduce a new row in the output? Some extra specification would be useful in trying to find a solution: what should be the form of the output? What do the arguments to POUND and FINDNEXT indicate? What if the argument to POUND does not start with "A"? And so on.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
