Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
TO FIND A WORD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Ganesh Kumar.J

New User


Joined: 06 Feb 2006
Posts: 4

PostPosted: Tue Feb 21, 2006 8:22 pm    Post subject: TO FIND A WORD
Reply with quote

HI !
Can anyone help me to find a word in a column of PDS file, using REXX commands.

I tried the following coding ,it answers for all the steps expect the last step" SAY 'THE POSITION:' POS(STR,PIC,(8))" .i cant able to find the defect , i need correct way to proceed, so please give me some sample coding or valuable suggestions.
Code:
         
/*************REXX***********************************/
SAY 'ENTER THE FILE NAME :'                                             
PULL FNAME                                                             
"ALLOC DA("FNAME") F(MYDD) SHR REUSE"                                   
"EXECIO * DISKR MYDD(STEM STR."                                         
SAY 'THE RECORDS ARE :'                                                 
DO I = 1 TO STR.0                                                       
  RESULT = FIND(STR.I,PIC)                                           
  IF RESULT \= 0 THEN                                             
    DO                                                             
      SAY 'FOUND IN LINE' I                                         
      SAY 'THE STRING IS:' STR.I                                     
    END                                                           
END                                                                     
SAY 'THE POSITION:' POS(STR,PIC,(8))
Back to top
View user's profile Send private message

jon_s_rice

Active User


Joined: 24 Mar 2005
Posts: 102
Location: Douglasville, GA USA

PostPosted: Wed Feb 22, 2006 3:01 am    Post subject:
Reply with quote

I recommend not using the variable result. This is a special variable in ReXX. Use some other name such as the following logic starting with the do loop.

do i = 1 to str.0
pic_pos = pos(str.i,"PIC")
if pic_pos \= 0 then do
say "found in line" i
say "the string is str.i
end
end

Your last line of code does not fit in. Note that PIC is in quotes. If it is not in qoutes it will be the value of the variable pic or it will be "PIC" if pic has no value. The last step has the following errors. The varable str has no value. Pic is not in quotes. I'm not sure how the third parameter will be interpreted.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts RACF- How to find the Last access of ... rahul shanmuganatan All Other Mainframe Topics 6 Thu Jun 21, 2018 3:19 pm
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us