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
 

 

Free DA Return code = 12

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

New User


Joined: 23 Feb 2009
Posts: 2
Location: maryland, usa

PostPosted: Tue Mar 03, 2009 8:59 pm    Post subject: Free DA Return code = 12
Reply with quote

Hi,

I am in the process of testing a REXX program, and received a return code of 12 while trying to free the Dataset.


Code:

"ALLOC DA('"CPYIN"') FI(RCDIN) SHR"               
VMCC = RC                                         
IF VMCC = 0 THEN                                 
   DO                                             
   "CALL 'SSA.ET995.LOAD(CKBLKCTL)'"             
    DMCC = RC                                     
     IF DMCC > 0 THEN                             
      DO                                         
      SAY "       FILE " CPYIN                   
      SAY "         IS EMPTY, READING NEXT RECORD"
      SIGNAL READEREC                             
      END                                         
   END                                           
"FREE DA('"CPYIN"')"                     
IF DMCC = 0 THEN                                     
  DO                                                 
     IF CNTYPE = "AFP" THEN                         
     DO                                             
       ISPEXEC FTCLOSE                               
       ISPEXEC FTOPEN TEMP                           
       ISPEXEC FTINCL CNREGAFP                       
          VMCC = RC                                 
         IF VMCC \= 0 THEN                           
            DO                                       
              ISPEXEC SETMSG MSG(VALID002)           
              SIGNAL FINI                           
            END                                     
         IF VMCC = 0 THEN                           
            DO                                       
              ISPEXEC FTCLOSE                       
              ISPEXEC VGET ZTEMPF ASIS               
         


Input File used for testing contains 2 to 3 different files, one of them is empty. For example the input file REGR.TEST.FY08.REGR.DATA, has the following data:


ABC.XYZ
DEF.XYZ.EMPTY
TEST1.FILE
ENDOFFILE


Of the above files, second file ie DEF.XYZ.EMPTY is empty.

The program processes the first two files successfully. But when the control comes to the third file, we get a RC =12 while performing the statement "FREE DA('"CPYIN"')" and so control does not go to the IF statement.

We tested with different types of input files. But it looks like whenever it tries to process a file after the empty file, it gives a RC of 12 (for FREE DA).

Please let us know what might have gone wrong in the code so that it would process all the files (irrespective of whether it is before or after the empty file) that are mentioned in the input file.

Please let me know if you have any questions.

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

Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2051
Location: Silicon Valley

PostPosted: Tue Mar 03, 2009 10:19 pm    Post subject: Reply to: Free DA Return code = 12
Reply with quote

Please add a trace instruction
Code:
TRACE('R')

and show us the result.
Back to top
View user's profile Send private message
Rajimohan

New User


Joined: 23 Feb 2009
Posts: 2
Location: maryland, usa

PostPosted: Wed Mar 04, 2009 1:35 am    Post subject: Reply to: Free DA Return code = 12
Reply with quote

Hi,

Thanks for the response, I tried with the TRACE ('R'), following is the output.

The filenames

MIRSSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP and MIRSSA.ET994.AUG08.BD05.IUMIRNOT.SKELCOMP, are the subsequent files after the empty file in the input Dataset (please refer my previous post)

Code:

"EXECIO 1 DISKR EFILEIN"                     
  "EXECIO 1 DISKR EFILEIN"                   
PULL ENRCD                                   
  "MIRSSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP
    "                                         
IF ENRCD = "ENDOFFILE"                       
  "0"                                         
APPLID = SUBSTR(ENRCD,1,3)                   
  "MIR"                                       
CPYIN  = SUBSTR(ENRCD,4,47)                   
  "SSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP   
     CPYIN  = STRIP(CPYIN)                                           
          "SSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP"                     
     /* THE FOLLOWING REMOVES TRAILING BLANKS */                     
    DSNM = STRIP( CPYIN )                                           
          "SSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP"                     
     "ISPEXEC VPUT("CPYIN") SHARED"                                   
       >>>   "ISPEXEC VPUT(SSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP) SHARED"
       +++ RC(20) +++                                                       
    SAY "PROCESSING FILE " CPYIN                                     
          "PROCESSING FILE  SSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP"   
PROCESSING FILE  SSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP   
...........................               

"ALLOC DA('"CPYIN"') FI(RCDIN) SHR"                                 
  "ALLOC DA('SSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP') FI(RCDIN) SHR
                                                                   
RC(12) +++                                                         
VMCC = RC                                                           
  "12"                                                             
IF VMCC = 0                                                         
  "0"                                                               
"FREE DA('"CPYIN"')"                                               
  "FREE DA('SSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP')"             
RC(12) +++                                                         
IF DMCC = 0                                                         
  "0"                                                               
JOBNU = JOBNU+1                             
  "12"                                     
SIGNAL READEREC                             
READEREC:                                   
IF JOBNU > 99                               
  "0"                                       
"EXECIO 1 DISKR EFILEIN"                   
  "EXECIO 1 DISKR EFILEIN"                 
PULL ENRCD                                 
  "MIRSSA.ET994.AUG08.BD05.IUMIRNOT.SKELCOMP
    "                                       
IF ENRCD = "ENDOFFILE"                     
  "0"                                       
APPLID = SUBSTR(ENRCD,1,3)                 
  "MIR"                                     
CPYIN  = SUBSTR(ENRCD,4,47)                 
  "SSA.ET994.AUG08.BD05.IUMIRNOT.SKELCOMP   
CPYIN  = STRIP(CPYIN)                       
  "SSA.ET994.AUG08.BD05.IUMIRNOT.SKELCOMP" 
/* THE FOLLOWING REMOVES TRAILING BLANKS */
DSNM = STRIP( CPYIN )                       
  "SSA.ET994.AUG08.BD05.IUMIRNOT.SKELCOMP" 
"ISPEXEC VPUT("CPYIN") SHARED"             
       >>>   "ISPEXEC VPUT(SSA.ET994.AUG08.BD05.IUMIRNOT.SKELCOMP) SHARED"
       +++ RC(20) +++                                                     
    99 *-* SAY "PROCESSING FILE " CPYIN                                   
       >>>   "PROCESSING FILE  SSA.ET994.AUG08.BD05.IUMIRNOT.SKELCOMP"   
PROCESSING FILE  SSA.ET994.AUG08.BD05.IUMIRNOT.SKELCOMP                   
"ALLOC DA('"CPYIN"') FI(RCDIN) SHR"                                 
  "ALLOC DA('SSA.ET994.AUG08.BD05.IUMIRNOT.SKELCOMP') FI(RCDIN) SHR"
RC(12) +++                                                         
VMCC = RC                                                           
  "12"                                                             
IF VMCC = 0                                                         
  "0"                                                               
"FREE DA('"CPYIN"')"                                               
  "FREE DA('SSA.ET994.AUG08.BD05.IUMIRNOT.SKELCOMP')"               
RC(12) +++                                                         
IF DMCC = 0                                                         


Please let me know, why I am getting RC=12 for FREE DA for both the datasets mentioned above.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2051
Location: Silicon Valley

PostPosted: Wed Mar 04, 2009 1:57 am    Post subject: Reply to: Free DA Return code = 12
Reply with quote

I think you should only FREE it if you had first successfully allocated it.

And my preference is to FREE by ddname, rather than by dataset name.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Wed Mar 04, 2009 2:09 am    Post subject: Reply to: Free DA Return code = 12
Reply with quote

I agree. I also don't like seeing ALLOCATES without the REUSE parameter.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Mar 04, 2009 12:28 pm    Post subject:
Reply with quote

Code:

     "ISPEXEC VPUT("CPYIN") SHARED"                                   
       >>>   "ISPEXEC VPUT(SSA.ET994.AUG084.NOT02.IUMIRNOT.SKELCOMP) SHARED"
       +++ RC(20) +++                                                       

Correct the first error shown and then work through the others, unless of course some of them disappear after correcting the first one.
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 EXIT or RETURN cvnlynn CLIST & REXX 16 Wed Jul 19, 2017 2:50 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am


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