View previous topic :: View next topic
|
Author |
Message |
flyingleo
New User
Joined: 09 Jul 2009 Posts: 14 Location: Stamford, CT
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
flyingleo
New User
Joined: 09 Jul 2009 Posts: 14 Location: Stamford, CT
|
|
|
|
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 |
|
|
|