IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Find the absolute position of a string in a given record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Aham

New User


Joined: 24 Oct 2007
Posts: 42
Location: chennai

PostPosted: Sun Dec 09, 2007 5:43 pm
Reply with quote

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
View user's profile Send private message
Aham

New User


Joined: 24 Oct 2007
Posts: 42
Location: chennai

PostPosted: Mon Dec 10, 2007 11:54 pm
Reply with quote

icon_sad.gif no replies for my post. my question sounds so inane ? icon_rolleyes.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 11, 2007 12:03 am
Reply with quote

Do you mean "inane" or "insane"? icon_smile.gif

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Dec 11, 2007 12:03 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 11, 2007 12:06 am
Reply with quote

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
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Dec 11, 2007 2:51 am
Reply with quote

A little Cobol program or even a smaller Rexx program would do the job.

;)
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Dec 11, 2007 11:45 am
Reply with quote

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
View user's profile Send private message
Aham

New User


Joined: 24 Oct 2007
Posts: 42
Location: chennai

PostPosted: Tue Dec 11, 2007 12:51 pm
Reply with quote

Thanks a lot for all your replies.

Frank - You are equally good in being humerous too icon_smile.gif 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
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Tue Dec 11, 2007 6:04 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top