MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Retrieve Data from a relative location - rexx/utilities

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
newuser
Beginner


Joined: 12 Jun 2003
Posts: 16
Topics: 8

PostPosted: Tue Aug 03, 2004 4:13 pm    Post subject: Retrieve Data from a relative location - rexx/utilities Reply with quote

Hi,
I need to read a file and check if the string '000300002000' is present anywhere in the record. If the string is present, then I need to navigate forward 249 bytes from this(start of 000300002000) position and retrieve 35 bytes at that location.

Suppose, the string '000300002000' is found for one record at 130th offset, then I from 130th offset I need to navigate 249 bytes forward (that is 130+249=) 379th offset. I need to retreive 35 bytes starting from 379th offset and put it into an output file.

Can somebody please share a sample rexx for this

cheers
Back to top
View user's profile Send private message
moyeenkhan
Beginner


Joined: 04 Dec 2002
Posts: 64
Topics: 21

PostPosted: Tue Aug 03, 2004 5:32 pm    Post subject: Reply with quote

Code:

EXECIO * DISKR ddname (STEM xData. FINIS'
Do I = 1 By 1 Until I=xData.0
 nPos=Pos('000300002000',xData.I)
 If nPos>0 Then Do
  nNewPos=nPos+249
  xNeededData=Substr(xData.I,nNewPos,35)
   Say xNeededData
    End
 End

Hope this helps
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group