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

Contention error, how to Free the file after it created


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

New User


Joined: 09 Jul 2009
Posts: 14
Location: Stamford, CT

PostPosted: Wed Jan 13, 2010 7:48 pm
Reply with quote

Hi,

Below Is my REXX code for creating a flat file and SUBMIT RUNJOB call STATEMENT which take the input form the flat file and run, but i can getting contention error,
can you please help me to solve contention issue(How to Free the File which created in First Step).


Code:

***************************** Top of Data **************************
/* REXX PRODDETL */                                                 
ARG TESTA                                                           

/*CREATING A FLAT FILE  */

 DDNAME = 'PRINT1'                                                 
 NT = CNTTST.DETAILS                                               
 ADDRESS TSO                                                       
 "ALLOC DS("NT") DD("DDNAME") DSORG(PS) LRECL(80) RECFM(F B)" ,     
"OLD REU UNIT(VIO)"                                                   
IF RC \= 0 THEN DO                                                     
       "ISPEXEC SETMSG MSG(ISRZ002)"                                   
       EXIT                                                           
END                                                                   

CALL DETAIL                                                           
CALL RUNJOB                                                           

/*WRITING A TESTA TO FLAT FILE CREATED IN ABOVE STEPS  */
DETAIL :                                                               
"ALLOC FI(SYSIN) DUMMY SHR REU"                                       
"ALLOC F(SYSOUT) UNIT(SYSDA) NEW SPACE(5 1) CYL REU"                   
"ALLOC FI(FNT) MOD DA("NT") REUSE"                                     
K = 1                                                                 
PRINT.K = TESTA                                                       
ADDRESS TSO "EXECIO * DISKW PRINT1 (STEM PRINT. FINIS"                 
RETURN                                                                 
                                                         
/* SUBMITTING A JOB WITH THE ABOVE CREATED FILE  */             
RUNJOB :                                                               
"FREE FILE(NT)"                                                       
"SUBMIT 'XXXXXX.DEENA.REXX5(SAMRUN)'"                                 
RETURN                                                                 
**************************** Bottom of Data ****************************



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

Global Moderator


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

PostPosted: Wed Jan 13, 2010 8:00 pm
Reply with quote

You allocate the dataset here:

"ALLOC FI(FNT) MOD DA("NT") REUSE"

but you never issue a FREE for that DD statement (FNT). And with MOD you have exclusive use of the dataset.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jan 13, 2010 8:03 pm
Reply with quote

It seems that you have the same file allocated to two different DD names at the same time. IMHO not the greatest of practices.

Have you tried to FREE both DD names in preference to one free of the dataset name.
Back to top
View user's profile Send private message
flyingleo

New User


Joined: 09 Jul 2009
Posts: 14
Location: Stamford, CT

PostPosted: Wed Jan 13, 2010 10:32 pm
Reply with quote

thanks a lot.

now its working, i freeded both the file.

Code:

DETAIL :                                                               
"ALLOC FI(SYSIN) DUMMY SHR REU"                                       
"ALLOC F(SYSOUT) UNIT(SYSDA) NEW SPACE(5 1) CYL REU"                   
"ALLOC FI(FNT) MOD DA("NT") REUSE"                                     
"FREE FILE(FNT)"            /*FREE*/                                           
K = 1                                                                 
PRINT.K = TESTA                                                       
ADDRESS TSO "EXECIO * DISKW PRINT1 (STEM PRINT. FINIS"                 
"FREE FILE(PRINT1)"       /*FREE*/                                             
RETURN                                                                 
                                                                       
RUNJOB :                                                               
"SUBMIT 'XXXXXX.DEENA.REXX5(SAMRUN)'"                                 

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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top