View previous topic :: View next topic
|
Author |
Message |
shweta bansal5
New User
Joined: 02 Aug 2011 Posts: 10 Location: India
|
|
|
|
Hi,
I have written a CLIST which is running in loop. At one time one dataset is allocated to one DDNAME. Next time, different dataset is allocated to that DDNAME. I need to get number of rows in those datasets so I am using EXECIO DISKR for that.
But the problem is first loop is correct. But in the next loop, allocation is failed.
One more notable point is that the files are very bulky and there is enough processing happening on each file in each loop.
Can someone help me resolve this issue?
Thanks,
Shweta |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Do you FREE the allocation when done, and use the REUSE parameter on your ALLOCATE command> |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
But in the next loop, allocation is failed. |
if You want any help You must tell how the allocation failed, not just whine about it |
|
Back to top |
|
|
shweta bansal5
New User
Joined: 02 Aug 2011 Posts: 10 Location: India
|
|
|
|
Yes. I am doing both of these. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
do You understand that to get some help You must provide more info ? |
|
Back to top |
|
|
shweta bansal5
New User
Joined: 02 Aug 2011 Posts: 10 Location: India
|
|
|
|
Here is the sample code, I am using -
Code: |
DO WHILE (FIRSTSCRN = TRUE)
"ISPEXEC DISPLAY PANEL(onepanel)"
IF panel indicator1 = 'Y' THEN
DTST = SYSUID||'.dsn1
IF panel indicator2 = 'Y' THEN
DTST = SYSUID||'.dsn2
IF panel indicator3 = 'Y' THEN
DTST = SYSUID||'.dsn3
IF SYSDSN("'"DTST"'") = 'OK' THEN DO
"FREE DDNAME(DTST)"
"ALLOC DSNAME('"DTST"') DDNAME(DTST) shr reu"
"EXECIO * DISKR DTST (STEM DATA. FINIS"
RECNUM = DATA.0
"FREE DDNAME(DTST)"
END
Some other processing
End
|
In above code, allocation command is giving return code 0 first time. But the next time onwards, its giving me 20 return code.
I am not able to trace why its happening. Does somebody have any idea or clue about this? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
'S funny. I was going to suggest you write it in rexx rather than CLIST, but you must have read my mind.
What is a "bulky" dataset? What is "enough" processing? What are the "rows" on your dataset? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
the way the snippet is posted I wonder even that it worked the first time
why not check the return codes after every and each command invoked |
|
Back to top |
|
|
shweta bansal5
New User
Joined: 02 Aug 2011 Posts: 10 Location: India
|
|
|
|
I have resolved the issue. Thanks everyone for spending time on this.
The issue was Address got changed in the later processing. And I had change it back to ADDRESS TSO before ALLOC command. This silly mistake took my 1 hour.. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
that one of the reasons to build a wrapper around each environment to be addrssed..
it also has the advantage os streamlining the code and using alway the proper Address ENVIRONMENT
see a panel display loop
without a wrapper
Code: |
/* REXX */
... the usual initialization stuff
/* first time thru */
Address ISPEXEC "DISPLAY PANEL (<somepanel>) "
do while ( RC = 0 )
...
<process the panel data >
...
Address ISPEXEC "DISPLAY PANEL (<somepanel>) "
end
... the usual termination stuff
exit
|
with a wrapper
Code: |
/* REXX */
... the usual initialization stuff
do while ( $ispexc("DISPLAY PANEL (<somepanel>)") = 0 )
...
<process the panel data >
...
end
... the usual termination stuff
exit
... the wrappers
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$tsoex:
tso_0tr = trace("O")
Address TSO arg(1)
tso_0rc = rc
trace value(tso_0tr)
return tso_0rc
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$ispex:
isp_tr = trace("O")
Address ISPEXEC arg(1)
isp_rc = rc
trace value(isp_tr)
return isp_rc
|
|
|
Back to top |
|
|
|