View previous topic :: View next topic
|
Author |
Message |
Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
Is there a way I can find out the absolute position of a string in a record so that I can process it further. I have an input file and there are more than one record types in them. They may a have a string say 'Account name' in diffenet positions and based on the starting of them my further processing should be done. Logical record length is too high and also there are substaintial type of records. So using the IFTHEN WHEN is not feasible. Is that possible to get the absolute position of the string? |
|
Back to top |
|
|
Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
no replies for my post. my question sounds so inane ? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Do you mean "inane" or "insane"?
There's no built-in function to get the absolute position of a string. Since you ruled out IFTHEN, I had nothing to offer and so didn't post a reply. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Aham wrote: |
Is there a way I can find out the absolute position of a string in a record so that I can process it further. I have an input file and there are more than one record types in them. They may a have a string say 'Account name' in diffenet positions and based on the starting of them my further processing should be done. Logical record length is too high and also there are substaintial type of records. So using the IFTHEN WHEN is not feasible. Is that possible to get the absolute position of the string? |
Use reference modification with a variable for the start position and do a perform varying to look for a match with your literal. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Use reference modification with a variable for the start position and do a perform varying to look for a match with your literal. |
I assume your proposed solution has nothing to do with DFSORT - right? (You might have mentioned that considering this is the DFSORT/ICETOOL Forum.) |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
A little Cobol program or even a smaller Rexx program would do the job.
;) |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Aham,
Yes, You can use REXX to find the absolute posiiton of the string. You can make use of the Keyword POS .
Quote: |
my further processing should be done. |
What processing are you going to do after finding the absolute position? |
|
Back to top |
|
|
Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
Thanks a lot for all your replies.
Frank - You are equally good in being humerous too I can get your point.
Aaru - I am totally new to REXX. After getting the position I would execute a cobol program based on the record type identifed. So I want to write this position to a record. Is that possible ? |
|
Back to top |
|
|
Alain Benveniste
New User
Joined: 14 Feb 2005 Posts: 88
|
|
|
|
Aham,
What do you mean by
Code: |
Is there a way I can find out the absolute position of a string in a record so that I can process it further
|
Depending on your reply and if you could post how your recs look like I could take a look to find a dfsort solution.
alain |
|
Back to top |
|
|
|