IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem while allocating a dataset again


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shweta bansal5

New User


Joined: 02 Aug 2011
Posts: 10
Location: India

PostPosted: Mon Oct 03, 2011 4:56 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Oct 03, 2011 5:00 pm
Reply with quote

Do you FREE the allocation when done, and use the REUSE parameter on your ALLOCATE command>
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 03, 2011 5:26 pm
Reply with quote

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 icon_evil.gif
Back to top
View user's profile Send private message
shweta bansal5

New User


Joined: 02 Aug 2011
Posts: 10
Location: India

PostPosted: Mon Oct 03, 2011 5:28 pm
Reply with quote

Yes. I am doing both of these.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 03, 2011 5:30 pm
Reply with quote

do You understand that to get some help You must provide more info ?
Back to top
View user's profile Send private message
shweta bansal5

New User


Joined: 02 Aug 2011
Posts: 10
Location: India

PostPosted: Mon Oct 03, 2011 5:39 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 03, 2011 5:41 pm
Reply with quote

'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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 03, 2011 5:44 pm
Reply with quote

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
View user's profile Send private message
shweta bansal5

New User


Joined: 02 Aug 2011
Posts: 10
Location: India

PostPosted: Mon Oct 03, 2011 5:48 pm
Reply with quote

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.. icon_sad.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 03, 2011 6:02 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top