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
 

 

Dataset Allocation error with RC 12

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 37

PostPosted: Wed Jul 08, 2015 1:12 pm    Post subject: Dataset Allocation error with RC 12
Reply with quote

I am trying to allocate mutilple datasets through a loop. however after i allocate 1st dataset, i am unable to allocate the 2nd dataset.

The 1st dataset is correctly allocated. the 2nd dataset when try to allocate fails with RC 12

The 2nd dataset when tried seperately is getting allocated.

here is my piece of code where i am reading a file and allcating a dataset based on file content through a loop

Code:
DO WHILE EOF = 'NO'                               
  "EXECIO 1 DISKR PARMS"                         
   IF RC = 2  THEN                               
     DO                                           
     EOF = 'YES'                                 
     SIGNAL EXIT                                 
   END                                           
   ELSE                                           
     PARSE PULL in_rec                           
    parms_read = parms_read+1                     
        membr  = (STRIP(SUBSTR(in_rec,01,8)))     
     
  call_retcode = 0                                                   
                                                                     
  schd_dsn = user||'.T.CSP.Q.'||membr                                 
                                                                     
  dsnfnd = LISTDSI("'"schd_dsn"'")  /* If data set already exist, */ 
                                    /* delete it.                 */ 
  IF sysreason = 0 THEN DO                                           
     "DELETE '"schd_dsn"'"                                           
  END                                                                 
     "ALLOC FI(OUTFILE) NEW SP(5 5) TR DSORG(PS) RECFM(F B)           
         LRECL(80)  DSN('"schd_dsn"')"                               
                                                                     
  SAY '****************'                                             
  SAY 'RETURN CODE '||RC                                             
  SAY 'REASON CODE '||sysreason                                       
  SAY '****************'                                             
  IF RC \= 0   THEN DO                                               
     SAY ' E Error allocating '||schd_dsn                             
/*   SIGNAL ERROR       */                                           
  END                                                                 
                                                                     
  CALL BUILD_JCL_SYMBOLICS                                           
                                                                     
  CALL WRITE_RECORD                                                   
                                                                     
  "FREE F(OUTFILE)"                                                   
                                                                     
END                                                                   
  RETURN call_retcode                                                 
  END           



I am not able to get the issue behind alloication.

Kindly help me

Thanks
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Jul 08, 2015 1:32 pm    Post subject: Reply to: Dataset Allocation error with RC 12
Reply with quote

And did you Trace it?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Wed Jul 08, 2015 2:08 pm    Post subject:
Reply with quote

It would help if you got all your code properly aligned. If that is how it appears on your ISPF screen then may the deities help whoever has to look after your code in the future.

And stop mucking about with unnecessary code:
Code:

read a record
do while rc = 0
   do the work
   read next record
end
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 460
Location: The Universe

PostPosted: Wed Jul 08, 2015 5:00 pm    Post subject:
Reply with quote

Works once, huh?

Are you using FILE(OUTFILE) in every allocation? That seems to me to be the most likely issue.

TSO/E Command Reference for your z/OS release just shows return codes 0 and 12 for the ALLOCATE command. Return code 12 shows "Allocation unsuccessful. An error message has been issued."

The ALLOCATE command generally issues fairly decent messages when something goes wrong. What messages did the second allocation issue?
Back to top
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 37

PostPosted: Thu Jul 09, 2015 10:39 am    Post subject: Reply to: Dataset Allocation error with RC 12
Reply with quote

i am able to resolve the issue. I missed to add below statements

Code:
"EXECIO 0 DISKW OUTFILE(FINIS"     
"FREE F(OUTFILE)"
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 S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm


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