View previous topic :: View next topic
|
Author |
Message |
JOYEETA PAUL Currently Banned New User
Joined: 18 Sep 2008 Posts: 17 Location: bangalore
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
The program will do what you tell it to do. You just need to work out the logic. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
JOYEETA PAUL Currently Banned New User
Joined: 18 Sep 2008 Posts: 17 Location: bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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.
Thanks in advance, |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 .. I will try it out |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
mmmm... cool feature to build commands... |
|
Back to top |
|
|
|