Rexx Query... Please help



IBM's Command List programming language & Restructured Extended Executor

Rexx Query... Please help

Postby bodhi » Wed Aug 08, 2007 11:58 am

Hello everybody,

i am back with yet another query.
i am sending you a piece of code i would like somebody to please give me a solution by looking at the following piece of code..

var.0 = 0
SAY 'PLEASE ENTER DATA SET NAME'
PULL DATA_SET
x = outtrap('var.')
"listds '"DATA_SET"' members"
do i = 1 to var.0
say 'no. of members are' var.0
say var.i
end
"alloc da( ? ) f(indd) shr reuse"
"execio * diskr indd (stem v."

in the above code my aim is to access the members which are stored in "VAR." variable. i would like to know what should be the value in DA( ? ) so that i will be able to access the members.


thanks
Bodhi
bodhi
 
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx Query... Please help

Postby MrSpock » Wed Aug 08, 2007 5:47 pm

Presuming that the whole concept here is to read and process each member of the PDS, then:

/* REXX */                                               
Say 'PLEASE ENTER DATA SET NAME'                         
Pull data_set                                             
data_set = Space(data_set,0)                             
x = Outtrap('var.')                                       
"LISTDS '"data_set"' MEMBERS"                             
x = Outtrap('Off')                                       
Say 'No. of members is' var.0                             
Do i = 7 To var.0                                         
  Say var.i                                               
  Parse Var var.i member .                               
  "ALLOC DA('"data_set"("member")') F(indd) SHR REU"     
  "EXECIO * DISKR indd (STEM v. FINIS"                   
  Say v.0                                                 
  Drop v.                                                 
End                                                       
"FREE F(indd)"                                           
Exit 0                                                   
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post