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 Profile Log in to check your private messages Log in
 
EXECIO in REXX Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
JOYEETA PAUL
Currently Banned

New User


Joined: 18 Sep 2008
Posts: 17
Location: bangalore

PostPosted: Thu Nov 20, 2008 8:26 pm    Post subject: EXECIO in REXX Program
Reply with quote

I've used EXECIO in my rexx prog. In my prog 1st I'm reading records from a PS and then want to write few lines from the recs into another member of a PDS. The prog can write all the records instead of few lines whatever I need. I can't use variables (to hold the rec and to check the rec) in EXECIO. So I can't use EXECIO in a loop to check the lines That I want to write. either * or a particular number I have to use for EXECIO. Can anybody tell me how I can use var in EXECIO.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Thu Nov 20, 2008 8:42 pm    Post subject: Reply to: EXECIO
Reply with quote

EXECIO Command format.

I don't understand your question. Take a look at the format of the EXECIO command and maybe tell us your understanding of how it works.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Nov 20, 2008 8:59 pm    Post subject:
Reply with quote

The program will do what you tell it to do. You just need to work out the logic.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Fri Nov 21, 2008 1:39 am    Post subject: Reply to: EXECIO in REXX Program
Reply with quote

Perhaps you do not know what stem variables are in rexx. Read the TSO Rexx Reference to understand stems. And then use the STEM parameter of the EXECIO command.
Back to top
View user's profile Send private message
JOYEETA PAUL
Currently Banned

New User


Joined: 18 Sep 2008
Posts: 17
Location: bangalore

PostPosted: Fri Nov 21, 2008 11:31 am    Post subject:
Reply with quote

this is my rexx prog to read a PS and write all the recs in a member of a PDS --
DSN = REXXFILE.LAWFILE
"ALLOC DD(DNB)DA("DSN") SHR"
'EXECIO * DISKR DNB (STEM LINES. OPEN'
DO I = 1 TO LINES.0
IF LINES.I = 'EOF' THEN
DO
SAY 'END OF CODE'
LEAVE
END
ELSE
NOP
END
"ALLOC FI(MYDD) DA('JOP3I0.TEST.JCLPDS(NEWMEM1)') SHR REUSE"
"EXECIO * DISKW MYDD (STEM LINES."
IF RC = 0 THEN /*RC=0 MEANS SUCCESSFUL COMPLETION*/
SAY 'ALL RECS ARE WRITTEN IN PS'
ELSE SAY 'NOT COMPLETED'
"FREE F(MYDD)"

this is working . but i want to read the PS and check each line (suppose i want to check with "*****"as in PS recs has line with *****) and until ***** i want to write recs in the new mem.I used * in EXECIO DISKW, but this will write all recs.so i want to use EXECIO in a loop, as lines.i holds the rec one by one, check it and write rec in member. so i want to use lines.i in EXECIO. but it is showing error as "use only number or * in EXECIO".how can i use EXECIO ?
I think now my qs is cleasr to all.i need ur help.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Fri Nov 21, 2008 11:45 am    Post subject: Reply to: EXECIO in REXX Program
Reply with quote

here is a snippet with the logic

Code:

-- initialize the script

-- read the lines
"EXECIO * DISKR INPUT (STEM LINES. FINIS"


-- initialize the output record count
j = 0

-- loop to process the lines
do   i = 1 to lines.0
   if   left(lines.i,3) = "EOF" then ,
      leave

   if   ... condition to write the output is satisfied .... then do
      j = j + 1 /* increment the output record count */
      -- build the output record
      outrec.j = ............
   end
end

-- check the output record count
if   j > 0 then do
   say "processed" j "records"
   -- allocate the output dataset
   "EXECIO" j "DISKW OUTPUT (STEM OUTREC. FINIS"
   -- free
end
else ,
   say "no records processed"

-- terminate

Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Fri Nov 21, 2008 10:19 pm    Post subject: Reply to: EXECIO in REXX Program
Reply with quote

Quote:
now my qs is cleasr to all.i need ur help

Maybe a little clearer, but please do not use chat slang.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1521
Location: Chennai

PostPosted: Wed Dec 17, 2008 6:12 pm    Post subject:
Reply with quote

Hi,

Just to add,

Is it possible to use a variable inside the EXECIO statement,

Eg.

Code:
"EXECIO 1 DISKR FZFILE '"COUNT"' (FINIS STEM IN."


in the above statement "count" is the variable.

I tried changing the " and ' but it does'nt seem to work.
Could you please show some light in the tunnel. icon_biggrin.gif

Thanks in advance,
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1521
Location: Chennai

PostPosted: Wed Dec 17, 2008 6:21 pm    Post subject:
Reply with quote

Could you please post some links for REXX manuals, something like "Getting started with REXX".

The manuals that we have in IBMMAINFRAMES.com are the complete reference and they are a little "vast".

I tried the web but still able to find only the TSO/E REXX Reference by IBM which is 564 pages icon_eek.gif

There are a couple of E-books for sale like Down to earth REXX.
If e-book is the only option please suggest some simplified book.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Wed Dec 17, 2008 6:47 pm    Post subject: Reply to: EXECIO in REXX Program
Reply with quote

First, if COUNT is a variable then you shouldn't be quoting it:

Code:

"EXECIO 1 DISKR FZFILE "COUNT" (FINIS STEM IN."


Second, these self-training suggestions were posted recently:

http://www.ibmmainframes.com/viewtopic.php?t=36224
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1521
Location: Chennai

PostPosted: Wed Dec 17, 2008 6:55 pm    Post subject:
Reply with quote

Thanks Superk for your time. It never occured to me to use " since I thought it would terminate the initial "


the book by Kilowatt Software L.L.C.
Classic Rexx Tutorial seems to be quite simple icon_biggrin.gif .. I will try it out
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu Dec 18, 2008 10:23 pm    Post subject: Reply to: EXECIO in REXX Program
Reply with quote

Quote:
I thought it would terminate the initial "

When you create a command like that, you can combine both constants (quoted strings) and variables. Rexx will resolve all of the variables before trying to pass the command to the command processor. So in this case, you DO want to terminate the initial double quote.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1521
Location: Chennai

PostPosted: Fri Dec 19, 2008 2:58 pm    Post subject:
Reply with quote

mmmm... cool feature to build commands... icon_biggrin.gif
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 ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 4 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm
No new posts How to Run Rexx Macro? Kalaivignesh CLIST & REXX 5 Fri Sep 01, 2017 9:08 pm
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

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