Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem while allocating a dataset again

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Problem while allocating a dataset again
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

Moderator Team Head


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

PostPosted: Mon Oct 03, 2011 5:00 pm    Post subject: Reply to: Problem while allocating a dataset again
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Oct 03, 2011 5:26 pm    Post subject: Reply to: Problem while allocating a dataset again
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Oct 03, 2011 5:30 pm    Post subject: Reply to: Problem while allocating a dataset again
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Mon Oct 03, 2011 5:41 pm    Post subject: Reply to: Problem while allocating a dataset again
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Oct 03, 2011 5:44 pm    Post subject: Reply to: Problem while allocating a dataset again
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Oct 03, 2011 6:02 pm    Post subject: Reply to: Problem while allocating a dataset again
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us