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
 

 

reading from a file

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

Active User


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

PostPosted: Thu Nov 19, 2009 10:45 pm    Post subject: reading from a file
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Thu Nov 19, 2009 11:03 pm    Post subject: Reply to: reading from a file
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

Senior Member


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

PostPosted: Thu Nov 19, 2009 11:47 pm    Post subject: Reply to: reading from a file
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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