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
 

 

Contention error, how to Free the file after it created

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Contention error, how to Free the file after it created
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

Moderator Team Head


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

PostPosted: Wed Jan 13, 2010 8:00 pm    Post subject: Reply to: Contention error, how to Free the file after it cr
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jan 13, 2010 8:03 pm    Post subject:
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    Post subject: Reply to: Contention error, how to Free the file after it cr
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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