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


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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.
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                                             
      SAY 'FOUND IN LINE' I                                         
      SAY 'THE STRING IS:' STR.I                                     
Back to top
View user's profile Send private message

Active User

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

PostPosted: Wed Feb 22, 2006 3:01 am
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

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
Search our Forums:

Back to Top