Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us