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

EXECIO in REXX Program


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Thu Nov 20, 2008 8:42 pm
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: 8797
Location: Welsh Wales

PostPosted: Thu Nov 20, 2008 8:59 pm
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

Global Moderator


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

PostPosted: Fri Nov 21, 2008 1:39 am
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 21, 2008 11:45 am
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

Global Moderator


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

PostPosted: Fri Nov 21, 2008 10:19 pm
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: 1742
Location: Tirupur, India

PostPosted: Wed Dec 17, 2008 6:12 pm
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: 1742
Location: Tirupur, India

PostPosted: Wed Dec 17, 2008 6:21 pm
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

Global Moderator


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

PostPosted: Wed Dec 17, 2008 6:47 pm
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:

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: 1742
Location: Tirupur, India

PostPosted: Wed Dec 17, 2008 6:55 pm
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

Global Moderator


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

PostPosted: Thu Dec 18, 2008 10:23 pm
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: 1742
Location: Tirupur, India

PostPosted: Fri Dec 19, 2008 2:58 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Using API Gateway from CICS program CICS 0
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top