Page 1 of 1

Rexx Query... Please help

PostPosted: Wed Aug 08, 2007 11:58 am
by bodhi
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

Re: Rexx Query... Please help

PostPosted: Wed Aug 08, 2007 5:47 pm
by MrSpock
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