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: 10210
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: 2025
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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