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

reading from a file


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Thu Nov 19, 2009 10:45 pm
Reply with quote

hi,
suppose my file structure is

abcd1
pqrs2
wxyz3

and i need to compare the 5th character(i.e. 1,2,3 etc) of the file with some variable then how can i do it in REXX.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Thu Nov 19, 2009 10:55 pm
Reply with quote

You look in the REXX Manual for a clue
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Nov 19, 2009 11:03 pm
Reply with quote

/code snippet on

Code:
Address TSO "EXECIO * DISKR <ddname> (FINIS STEM rec."
do  i = 1 to rec.0
    if substr(rec.i,5,1) = <somechar> then do
        /* ... */
        /* ...   do some processing related to condition TRUE  */
        /* ... */
    end
    else do
        /* ... */
        /* ...   do some processing related to condition FALSE */
        /* ... */
    end

/code snippet off
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu Nov 19, 2009 11:47 pm
Reply with quote

To summarize, you need to study the rexx reference manual and search for the following topics:

EXECIO
SUBSTR
stem variables
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top