Posted: Thu Aug 20, 2009 11:32 am Post subject: Performance issue with LMLIST/LMCOPY in REXX
Hi All,
I have written a REXX program to copy the matching members into one PDS and non matching members into another PDS from my input PDS.
I am running this rexx job through JCL and it is taking more then 210 mins .
I have 13000 members in my input PDS. Can you please let me know how I can increase my job performance.
Code:
/* REXX */
/**********************************************************************
* Author : Chandra *
* *
* Input : In INDD, first row must be pds name in the following format*
* DSN=PDS.NAME *
* Search string should be MEM=SRCHSTR* *
* Output : Job names that matches the MEM name *
**********************************************************************/
If Substr(inrec.i,1,3) = 'DSN' Then
lib = Strip(Substr(inrec.i,5,44))
Else
Do
wmem.i =Strip(Substr(inrec.i,5,10))
wmem.i = Substr(wmem.i,1,Length(wmem.i)-1)
lmem.i = Length(wmem.i)
smem.i = wmem.i
End
End
If lmem.3 < 0 Then lmem.3 = 5 /* if no string ass dft val */
If lmem.4 < 0 Then lmem.4 = 5 /* if no string ass dft val */
If lmem.5 < 0 Then lmem.5 = 5 /* if no string ass dft val */
If lmem.6 < 0 Then lmem.6 = 5 /* if no string ass dft val */
/* To copy all the jobs that doesnot matches the input */
"ALLOC F(exjobs) DSORG(PO) SPACE(400,40) DIR(2000)",
"CYLINDERS LRECL(80) RECFM(F,B) NEW"
ADDRESS ISPEXEC "LMINIT DATAID(EXMEM) DDNAME(EXJOBS) ENQ(SHRW)"
If (Substr(wmem,1,lmem.2) = smem.2) |,
(Substr(wmem,1,lmem.3) = smem.3) |,
(Substr(wmem,1,lmem.4) = smem.4) |,
(Substr(wmem,1,lmem.4) = smem.5) |,
(Substr(wmem,1,lmem.5) = smem.6) Then
Do
/* To write the job names in the dataset */
Push wmem
"Execio 1 diskw JCLLIST"
/* To Copy the jobs that matches the input */
ADDRESS ISPEXEC "LMCOPY FROMID(&LISTM)",
" FROMMEM("WMEM") TODATAID(&INMEM)"
End
Else
Do
/* To Copy the jobs that doesnot matches the input */
ADDRESS ISPEXEC "LMCOPY FROMID(&LISTM)",
" FROMMEM("WMEM") TODATAID(&EXMEM)"
End
End
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
Posted: Thu Aug 20, 2009 4:59 pm Post subject:
I don't know why it is taking so long, but this is probably is opening and closing the data set and updating the directory (slow!) with each LMCOPY. I would suggest one of 2 alternate strategies:
Use the PATTERN() parameter of LMMLIST instead of your own parsing and then write SELECT M=(name) statements as input for IEBCOPY which you can then run either in your exec or as a batch job (hint.. alloc SYSUT1, SYSUT2, SYSPRINT DUMMY and SYSIN DUMMY, then SELECT PGM(IEBCOPY))
Copy the entire dataset to the not found destination and then use LMMOVE with a pattern to move the found members to the found data set. If you can use IEBCOPY for the initial copy, all the better because IEBCOPY only writes the directory once (assuming this is a PDS and not a PDSE).
Either strategy should be faster than doing individual copies. The 1st strategy would be fastest. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
I have changed my program to build the sysin parameter as shown by Diba and ran the IEBCOPY step through JCL and now it is running very fast now.
Thanks once again !!!
I have one more question, The program is running fine and I am getting the results but I am getting following messages in SYSPRINT. Can you let me know why I am getting these.
Code:
READY
ISPSTART CMD(JOBLIST)
MISSING DATA SET NAME+
MISSING NAME OF DATA SET TO BE ALLOCATED
FILE JCLLIST NOT ALLOCATED, FILE IN USE
FILE INJOBS NOT ALLOCATED, FILE IN USE
FILE EXJOBS NOT ALLOCATED, FILE IN USE
FILE INMEM NOT FREED, IS NOT ALLOCATED
FILE EXMEM NOT FREED, IS NOT ALLOCATED
$9KV.$9KVA.JOB15666.D0000107.? was preallocated (no free was done).
READY
END
The modified program is
Code:
/* REXX */
/**********************************************************************
* Author : Chandra Darur *
* *
* Input : In INDD, first row must be pds name in the following format*
* DSN=PDS.NAME *
* Search string should be MEM=SRCHSTR* *
* Output : Job names that matches the MEM name *
* "ALLOC FI(INDD) SHR REUSE" *
* "ALLOC F(JCLLIST) DA('TS09347.CMD35.DATASETS') OLD REUSE" *
**********************************************************************/
If Substr(inrec.i,1,3) = 'DSN' Then
lib = Strip(Substr(inrec.i,5,44))
Else
Do
wmem.i =Strip(Substr(inrec.i,5,10))
wmem.i = Substr(wmem.i,1,Length(wmem.i)-1)
lmem.i = Length(wmem.i)
smem.i = wmem.i
End
End
If lmem.3 < 0 Then lmem.3 = 5 /* if no string ass dft val */
If lmem.4 < 0 Then lmem.4 = 5 /* if no string ass dft val */
If lmem.5 < 0 Then lmem.5 = 5 /* if no string ass dft val */
If lmem.6 < 0 Then lmem.6 = 5 /* if no string ass dft val */
If (Substr(wmem,1,lmem.2) = smem.2) |,
(Substr(wmem,1,lmem.3) = smem.3) |,
(Substr(wmem,1,lmem.4) = smem.4) |,
(Substr(wmem,1,lmem.4) = smem.5) |,
(Substr(wmem,1,lmem.5) = smem.6) Then
Do
/* To write the job names in the dataset */
Push wmem
"Execio 1 diskw JCLLIST"
/* To Copy the jobs that matches the input */
imem = Strip(wmem)
Push " SELECT MEMBER=((" || imem || ",,R))"
"Execio 1 diskw injobs"
End
Else
Do
/* To Copy the jobs that doesnot matches the input */
imem = Strip(wmem)
Push " SELECT MEMBER=((" || imem || ",,R))"
"Execio 1 diskw exjobs"
End
End
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
Posted: Fri Aug 21, 2009 11:49 am Post subject:
The ddnames are already allocated, probably because of a previous error. Add the REUSE parameter on the ALLOC commands:
"ALLOC F(JCLLIST) DSORG(PS) SPACE(2,0) TRACKS", /* Output jobnames */
"LRECL(80) RECFM(F,B) NEW REUSE" _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum