View previous topic :: View next topic
|
Author |
Message |
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Hi,
I encountered a strange problem that I wrote a rexx to copy data from one file to another and using the output I submitted a JCL but it was saying the datasets was not free.
I did a TSO ISRDDN + ENQ and saw that the dataset was locked under my id.
I Checked the return code after freeying the dataset I saw it was 0.
But why was it still holding my dataset?
Any pointers will be really helpful.
Thanks in advance. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
premkrishnan wrote: |
Hi,
I encountered a strange problem that I wrote a rexx to copy data from one file to another and using the output I submitted a JCL but it was saying the datasets was not free.
I did a TSO ISRDDN + ENQ and saw that the dataset was locked under my id.
I Checked the return code after freeying the dataset I saw it was 0.
But why was it still holding my dataset?
Any pointers will be really helpful.
Thanks in advance. |
Please show us (using cut-and-paste and Code tags) a trace of the exec that allegedly frees the data set. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Code: |
164 *-* Seqfil = USER || '.TEMP.OPC.SEQ'
>V> "AFXDPR"
>L> ".TEMP.OPC.SEQ"
>O> "AFXDPR.TEMP.OPC.SEQ"
165 *-* Seqfil2= USER || '.TEMP.OPC'
>V> "AFXDPR"
>L> ".TEMP.OPC"
>O> "AFXDPR.TEMP.OPC"
166 *-* Msg = sysdsn("'"seqfil"'")
>L> "'"
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "'AFXDPR.TEMP.OPC.SEQ"
>L> "'"
>O> "'AFXDPR.TEMP.OPC.SEQ'"
>F> "DATASET NOT FOUND"
167 *-* If Msg ¬= 'OK'
>V> "DATASET NOT FOUND"
>L> "OK"
>O> "1"
*-* then
*-* do
168 *-* Address Tso "ALLOCATE DS('"Seqfil"') LIKE('"lib"')",
"DSORG(PS) "
>L> "ALLOCATE DS('"
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "ALLOCATE DS('AFXDPR.TEMP.OPC.SEQ"
>L> "') LIKE('"
>O> "ALLOCATE DS('AFXDPR.TEMP.OPC.SEQ') LIKE('"
>V> "TEST2.AFXDPR.OPC"
>O> "ALLOCATE DS('AFXDPR.TEMP.OPC.SEQ') LIKE('TEST2.AFX
DPR.OPC"
>L> "')"
>O> "ALLOCATE DS('AFXDPR.TEMP.OPC.SEQ') LIKE('TEST2.AFX
DPR.OPC')"
>L> "DSORG(PS) "
>O> "ALLOCATE DS('AFXDPR.TEMP.OPC.SEQ') LIKE('TEST2.AFX
DPR.OPC') DSORG(PS) "
170 *-* End
171 *-* Msg = sysdsn("'"seqfil2"'")
>L> "'"
>V> "AFXDPR.TEMP.OPC"
>O> "'AFXDPR.TEMP.OPC"
>L> "'"
>O> "'AFXDPR.TEMP.OPC'"
>F> "DATASET NOT FOUND"
172 *-* If Msg ¬= 'OK'
***
>V> "DATASET NOT FOUND"
>L> "OK"
>O> "1"
*-* then
*-* do
173 *-* Address Tso "ALLOCATE DS('"Seqfil2"') LIKE('"lib"')"
>L> "ALLOCATE DS('"
>V> "AFXDPR.TEMP.OPC"
>O> "ALLOCATE DS('AFXDPR.TEMP.OPC"
>L> "') LIKE('"
>O> "ALLOCATE DS('AFXDPR.TEMP.OPC') LIKE('"
>V> "TEST2.AFXDPR.OPC"
>O> "ALLOCATE DS('AFXDPR.TEMP.OPC') LIKE('TEST2.AFXDPR.
OPC"
>L> "')"
>O> "ALLOCATE DS('AFXDPR.TEMP.OPC') LIKE('TEST2.AFXDPR.
OPC')"
174 *-* End
176 *-* Seqfil3 = USER || '.TEMP.OPC'|| '(' || 'OPCTEMP' || ')'
>V> "AFXDPR"
>L> ".TEMP.OPC"
>O> "AFXDPR.TEMP.OPC"
>L> "("
***
>O> "AFXDPR.TEMP.OPC("
>L> "OPCTEMP"
>O> "AFXDPR.TEMP.OPC(OPCTEMP"
>L> ")"
>O> "AFXDPR.TEMP.OPC(OPCTEMP)"
177 *-* Address TSO "ALLOC FI(OPCTEMP) DA('"Seqfil"') MOD REU"
>L> "ALLOC FI(OPCTEMP) DA('"
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ"
>L> "') MOD REU"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ') MOD REU"
178 *-* Call Copy_mem
182 *-* Copy_mem:
183 *-* Infile = lib || '(' || mem1 || ')'
>V> "TEST2.AFXDPR.OPC"
>L> "("
>O> "TEST2.AFXDPR.OPC("
>V> "XXXX0002"
>O> "TEST2.AFXDPR.OPC(XXXX0002"
>L> ")"
>O> "TEST2.AFXDPR.OPC(XXXX0002)"
184 *-* Address Tso "ALLOC FI(INDS) DS('"Infile"') SHR REUSE"
>L> "ALLOC FI(INDS) DS('"
***
>V> "TEST2.AFXDPR.OPC(XXXX0002)"
>O> "ALLOC FI(INDS) DS('TEST2.AFXDPR.OPC(XXXX0002)"
>L> "') SHR REUSE"
>O> "ALLOC FI(INDS) DS('TEST2.AFXDPR.OPC(XXXX0002)') SH
R REUSE"
185 *-* Address Tso "EXECIO * DISKR INDS (STEM inrec. finis"
>L> "EXECIO * DISKR INDS (STEM inrec. finis"
186 *-* If Rep = 'Y'
>V> "Y"
>L> "Y"
>O> "1"
*-* Then
*-* Do
187 *-* inrec.1 = OVERLAY('ACTION(REPLACE)',inrec.1,30)
>L> "ACTION(REPLACE)"
>V> " OPTIONS DURUNIT(SECONDS)
"
>L> "30"
>F> " OPTIONS DURUNIT(SECONDS) ACTION(REPLACE)
"
188 *-* End
190 *-* Address Tso "EXECIO * DISKW OPCTEMP (STEM inrec. finis"
>L> "EXECIO * DISKW OPCTEMP (STEM inrec. finis"
***
191 *-* if rc := 0
>V> "0"
>L> "0"
>O> "0"
193 *-* else
194 *-* say "Process completed Successfully..."
>L> "Process completed Successfully..."
Process completed Successfully...
195 *-* ADDRESS TSO "FREE FI(OPCTEMP)"
>L> "FREE FI(OPCTEMP)"
196 *-* Say Rc
>V> "0"
0
197 *-* ADDRESS TSO "FREE FI(INDS)"
>L> "FREE FI(INDS)"
198 *-* Say Rc
>V> "0"
0
199 *-* Return
179 *-* Call Copy_Pds
201 *-* Copy_pds:
203 *-* Address TSO "ALLOC FI(OPCTEMP) DA('"Seqfil"') SHR"
>L> "ALLOC FI(OPCTEMP) DA('"
***
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ"
>L> "') SHR"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ') SHR"
204 *-* Address TSO "ALLOC FI(OPCTEMP2) DA('"Seqfil3"') SHR"
>L> "ALLOC FI(OPCTEMP2) DA('"
>V> "AFXDPR.TEMP.OPC(OPCTEMP)"
>O> "ALLOC FI(OPCTEMP2) DA('AFXDPR.TEMP.OPC(OPCTEMP)"
>L> "') SHR"
>O> "ALLOC FI(OPCTEMP2) DA('AFXDPR.TEMP.OPC(OPCTEMP)') SHR
"
205 *-* Address Tso "EXECIO * DISKR OPCTEMP (STEM temp1. finis"
>L> "EXECIO * DISKR OPCTEMP (STEM temp1. finis"
206 *-* Address Tso "EXECIO * DISKW OPCTEMP2 (STEM temp1. finis"
>L> "EXECIO * DISKW OPCTEMP2 (STEM temp1. finis"
207 *-* Address TSO "FREE FI(OPCTEMP2)"
>L> "FREE FI(OPCTEMP2)"
208 *-* Say Rc
>V> "0"
0
209 *-* Address TSO "FREE FI(OPCTEMP)"
>L> "FREE FI(OPCTEMP)"
210 *-* Say Rc
***
>V> "0"
0
211 *-* Return
180 *-* Return
164 *-* Seqfil = USER || '.TEMP.OPC.SEQ'
>V> "AFXDPR"
>L> ".TEMP.OPC.SEQ"
>O> "AFXDPR.TEMP.OPC.SEQ"
165 *-* Seqfil2= USER || '.TEMP.OPC'
>V> "AFXDPR"
>L> ".TEMP.OPC"
>O> "AFXDPR.TEMP.OPC"
166 *-* Msg = sysdsn("'"seqfil"'")
>L> "'"
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "'AFXDPR.TEMP.OPC.SEQ"
>L> "'"
>O> "'AFXDPR.TEMP.OPC.SEQ'"
>F> "OK"
167 *-* If Msg ¬= 'OK'
>V> "OK"
>L> "OK"
>O> "0"
***
171 *-* Msg = sysdsn("'"seqfil2"'")
>L> "'"
>V> "AFXDPR.TEMP.OPC"
>O> "'AFXDPR.TEMP.OPC"
>L> "'"
>O> "'AFXDPR.TEMP.OPC'"
>F> "OK"
172 *-* If Msg ¬= 'OK'
>V> "OK"
>L> "OK"
>O> "0"
176 *-* Seqfil3 = USER || '.TEMP.OPC'|| '(' || 'OPCTEMP' || ')'
>V> "AFXDPR"
>L> ".TEMP.OPC"
>O> "AFXDPR.TEMP.OPC"
>L> "("
>O> "AFXDPR.TEMP.OPC("
>L> "OPCTEMP"
>O> "AFXDPR.TEMP.OPC(OPCTEMP"
>L> ")"
>O> "AFXDPR.TEMP.OPC(OPCTEMP)"
177 *-* Address TSO "ALLOC FI(OPCTEMP) DA('"Seqfil"') MOD REU"
>L> "ALLOC FI(OPCTEMP) DA('"
***
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ"
>L> "') MOD REU"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ') MOD REU"
178 *-* Call Copy_mem
182 *-* Copy_mem:
183 *-* Infile = lib || '(' || mem1 || ')'
>V> "TEST1.AFXDPR.OPC"
>L> "("
>O> "TEST1.AFXDPR.OPC("
>V> "XXXX0002"
>O> "TEST1.AFXDPR.OPC(XXXX0002"
>L> ")"
>O> "TEST1.AFXDPR.OPC(XXXX0002)"
184 *-* Address Tso "ALLOC FI(INDS) DS('"Infile"') SHR REUSE"
>L> "ALLOC FI(INDS) DS('"
>V> "TEST1.AFXDPR.OPC(XXXX0002)"
>O> "ALLOC FI(INDS) DS('TEST1.AFXDPR.OPC(XXXX0002)"
>L> "') SHR REUSE"
>O> "ALLOC FI(INDS) DS('TEST1.AFXDPR.OPC(XXXX0002)') SH
R REUSE"
185 *-* Address Tso "EXECIO * DISKR INDS (STEM inrec. finis"
>L> "EXECIO * DISKR INDS (STEM inrec. finis"
***
186 *-* If Rep = 'Y'
>V> "Y"
>L> "Y"
>O> "1"
*-* Then
*-* Do
187 *-* inrec.1 = OVERLAY('ACTION(REPLACE)',inrec.1,30)
>L> "ACTION(REPLACE)"
>V> " OPTIONS DURUNIT(SECONDS)
"
>L> "30"
>F> " OPTIONS DURUNIT(SECONDS) ACTION(REPLACE)
"
188 *-* End
190 *-* Address Tso "EXECIO * DISKW OPCTEMP (STEM inrec. finis"
>L> "EXECIO * DISKW OPCTEMP (STEM inrec. finis"
191 *-* if rc := 0
>V> "0"
>L> "0"
>O> "0"
193 *-* else
194 *-* say "Process completed Successfully..."
>L> "Process completed Successfully..."
***
Process completed Successfully...
195 *-* ADDRESS TSO "FREE FI(OPCTEMP)"
>L> "FREE FI(OPCTEMP)"
196 *-* Say Rc
>V> "0"
0
197 *-* ADDRESS TSO "FREE FI(INDS)"
>L> "FREE FI(INDS)"
198 *-* Say Rc
>V> "0"
0
199 *-* Return
179 *-* Call Copy_Pds
201 *-* Copy_pds:
203 *-* Address TSO "ALLOC FI(OPCTEMP) DA('"Seqfil"') SHR"
>L> "ALLOC FI(OPCTEMP) DA('"
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ"
>L> "') SHR"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ') SHR"
204 *-* Address TSO "ALLOC FI(OPCTEMP2) DA('"Seqfil3"') SHR"
>L> "ALLOC FI(OPCTEMP2) DA('"
>V> "AFXDPR.TEMP.OPC(OPCTEMP)"
***
>O> "ALLOC FI(OPCTEMP2) DA('AFXDPR.TEMP.OPC(OPCTEMP)"
>L> "') SHR"
>O> "ALLOC FI(OPCTEMP2) DA('AFXDPR.TEMP.OPC(OPCTEMP)') SHR
"
205 *-* Address Tso "EXECIO * DISKR OPCTEMP (STEM temp1. finis"
>L> "EXECIO * DISKR OPCTEMP (STEM temp1. finis"
206 *-* Address Tso "EXECIO * DISKW OPCTEMP2 (STEM temp1. finis"
>L> "EXECIO * DISKW OPCTEMP2 (STEM temp1. finis"
207 *-* Address TSO "FREE FI(OPCTEMP2)"
>L> "FREE FI(OPCTEMP2)"
208 *-* Say Rc
>V> "0"
0
209 *-* Address TSO "FREE FI(OPCTEMP)"
>L> "FREE FI(OPCTEMP)"
210 *-* Say Rc
>V> "0"
0
211 *-* Return
180 *-* Return
164 *-* Seqfil = USER || '.TEMP.OPC.SEQ'
>V> "AFXDPR"
>L> ".TEMP.OPC.SEQ"
***
>O> "AFXDPR.TEMP.OPC.SEQ"
165 *-* Seqfil2= USER || '.TEMP.OPC'
>V> "AFXDPR"
>L> ".TEMP.OPC"
>O> "AFXDPR.TEMP.OPC"
166 *-* Msg = sysdsn("'"seqfil"'")
>L> "'"
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "'AFXDPR.TEMP.OPC.SEQ"
>L> "'"
>O> "'AFXDPR.TEMP.OPC.SEQ'"
>F> "OK"
167 *-* If Msg ¬= 'OK'
>V> "OK"
>L> "OK"
>O> "0"
171 *-* Msg = sysdsn("'"seqfil2"'")
>L> "'"
>V> "AFXDPR.TEMP.OPC"
>O> "'AFXDPR.TEMP.OPC"
>L> "'"
>O> "'AFXDPR.TEMP.OPC'"
>F> "OK"
***
172 *-* If Msg ¬= 'OK'
>V> "OK"
>L> "OK"
>O> "0"
176 *-* Seqfil3 = USER || '.TEMP.OPC'|| '(' || 'OPCTEMP' || ')'
>V> "AFXDPR"
>L> ".TEMP.OPC"
>O> "AFXDPR.TEMP.OPC"
>L> "("
>O> "AFXDPR.TEMP.OPC("
>L> "OPCTEMP"
>O> "AFXDPR.TEMP.OPC(OPCTEMP"
>L> ")"
>O> "AFXDPR.TEMP.OPC(OPCTEMP)"
177 *-* Address TSO "ALLOC FI(OPCTEMP) DA('"Seqfil"') MOD REU"
>L> "ALLOC FI(OPCTEMP) DA('"
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ"
>L> "') MOD REU"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ') MOD REU"
178 *-* Call Copy_mem
182 *-* Copy_mem:
183 *-* Infile = lib || '(' || mem1 || ')'
***
>V> "TEST2.AFXDPR.OPC"
>L> "("
>O> "TEST2.AFXDPR.OPC("
>V> "XXXX001"
>O> "TEST2.AFXDPR.OPC(XXXX001"
>L> ")"
>O> "TEST2.AFXDPR.OPC(XXXX001)"
184 *-* Address Tso "ALLOC FI(INDS) DS('"Infile"') SHR REUSE"
>L> "ALLOC FI(INDS) DS('"
>V> "TEST2.AFXDPR.OPC(XXXX001)"
>O> "ALLOC FI(INDS) DS('TEST2.AFXDPR.OPC(XXXX001)"
>L> "') SHR REUSE"
>O> "ALLOC FI(INDS) DS('TEST2.AFXDPR.OPC(XXXX001)') SHR
REUSE"
185 *-* Address Tso "EXECIO * DISKR INDS (STEM inrec. finis"
>L> "EXECIO * DISKR INDS (STEM inrec. finis"
186 *-* If Rep = 'Y'
>V> "Y"
>L> "Y"
>O> "1"
*-* Then
*-* Do
187 *-* inrec.1 = OVERLAY('ACTION(REPLACE)',inrec.1,30)
***
>L> "ACTION(REPLACE)"
>V> " OPTIONS DURUNIT(SECONDS)
00010000"
>L> "30"
>F> " OPTIONS DURUNIT(SECONDS) ACTION(REPLACE)
00010000"
188 *-* End
190 *-* Address Tso "EXECIO * DISKW OPCTEMP (STEM inrec. finis"
>L> "EXECIO * DISKW OPCTEMP (STEM inrec. finis"
191 *-* if rc := 0
>V> "0"
>L> "0"
>O> "0"
193 *-* else
194 *-* say "Process completed Successfully..."
>L> "Process completed Successfully..."
Process completed Successfully...
195 *-* ADDRESS TSO "FREE FI(OPCTEMP)"
>L> "FREE FI(OPCTEMP)"
196 *-* Say Rc
>V> "0"
0
197 *-* ADDRESS TSO "FREE FI(INDS)"
***
>L> "FREE FI(INDS)"
198 *-* Say Rc
>V> "0"
0
199 *-* Return
179 *-* Call Copy_Pds
201 *-* Copy_pds:
203 *-* Address TSO "ALLOC FI(OPCTEMP) DA('"Seqfil"') SHR"
>L> "ALLOC FI(OPCTEMP) DA('"
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ"
>L> "') SHR"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ') SHR"
204 *-* Address TSO "ALLOC FI(OPCTEMP2) DA('"Seqfil3"') SHR"
>L> "ALLOC FI(OPCTEMP2) DA('"
>V> "AFXDPR.TEMP.OPC(OPCTEMP)"
>O> "ALLOC FI(OPCTEMP2) DA('AFXDPR.TEMP.OPC(OPCTEMP)"
>L> "') SHR"
>O> "ALLOC FI(OPCTEMP2) DA('AFXDPR.TEMP.OPC(OPCTEMP)') SHR
"
205 *-* Address Tso "EXECIO * DISKR OPCTEMP (STEM temp1. finis"
>L> "EXECIO * DISKR OPCTEMP (STEM temp1. finis"
206 *-* Address Tso "EXECIO * DISKW OPCTEMP2 (STEM temp1. finis"
***
>L> "EXECIO * DISKW OPCTEMP2 (STEM temp1. finis"
207 *-* Address TSO "FREE FI(OPCTEMP2)"
>L> "FREE FI(OPCTEMP2)"
208 *-* Say Rc
>V> "0"
0
209 *-* Address TSO "FREE FI(OPCTEMP)"
>L> "FREE FI(OPCTEMP)"
210 *-* Say Rc
>V> "0"
0
211 *-* Return
180 *-* Return
164 *-* Seqfil = USER || '.TEMP.OPC.SEQ'
>V> "AFXDPR"
>L> ".TEMP.OPC.SEQ"
>O> "AFXDPR.TEMP.OPC.SEQ"
165 *-* Seqfil2= USER || '.TEMP.OPC'
>V> "AFXDPR"
>L> ".TEMP.OPC"
>O> "AFXDPR.TEMP.OPC"
166 *-* Msg = sysdsn("'"seqfil"'")
>L> "'"
***
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "'AFXDPR.TEMP.OPC.SEQ"
>L> "'"
>O> "'AFXDPR.TEMP.OPC.SEQ'"
>F> "OK"
167 *-* If Msg ¬= 'OK'
>V> "OK"
>L> "OK"
>O> "0"
171 *-* Msg = sysdsn("'"seqfil2"'")
>L> "'"
>V> "AFXDPR.TEMP.OPC"
>O> "'AFXDPR.TEMP.OPC"
>L> "'"
>O> "'AFXDPR.TEMP.OPC'"
>F> "OK"
172 *-* If Msg ¬= 'OK'
>V> "OK"
>L> "OK"
>O> "0"
176 *-* Seqfil3 = USER || '.TEMP.OPC'|| '(' || 'OPCTEMP' || ')'
>V> "AFXDPR"
>L> ".TEMP.OPC"
***
>O> "AFXDPR.TEMP.OPC"
>L> "("
>O> "AFXDPR.TEMP.OPC("
>L> "OPCTEMP"
>O> "AFXDPR.TEMP.OPC(OPCTEMP"
>L> ")"
>O> "AFXDPR.TEMP.OPC(OPCTEMP)"
177 *-* Address TSO "ALLOC FI(OPCTEMP) DA('"Seqfil"') MOD REU"
>L> "ALLOC FI(OPCTEMP) DA('"
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ"
>L> "') MOD REU"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ') MOD REU"
178 *-* Call Copy_mem
182 *-* Copy_mem:
183 *-* Infile = lib || '(' || mem1 || ')'
>V> "TEST1.AFXDPR.OPC"
>L> "("
>O> "TEST1.AFXDPR.OPC("
>V> "XXXX001"
>O> "TEST1.AFXDPR.OPC(XXXX001"
>L> ")"
>O> "TEST1.AFXDPR.OPC(XXXX001)"
***
184 *-* Address Tso "ALLOC FI(INDS) DS('"Infile"') SHR REUSE"
>L> "ALLOC FI(INDS) DS('"
>V> "TEST1.AFXDPR.OPC(XXXX001)"
>O> "ALLOC FI(INDS) DS('TEST1.AFXDPR.OPC(XXXX001)"
>L> "') SHR REUSE"
>O> "ALLOC FI(INDS) DS('TEST1.AFXDPR.OPC(XXXX001)') SHR
REUSE"
185 *-* Address Tso "EXECIO * DISKR INDS (STEM inrec. finis"
>L> "EXECIO * DISKR INDS (STEM inrec. finis"
186 *-* If Rep = 'Y'
>V> "Y"
>L> "Y"
>O> "1"
*-* Then
*-* Do
187 *-* inrec.1 = OVERLAY('ACTION(REPLACE)',inrec.1,30)
>L> "ACTION(REPLACE)"
>V> " OPTIONS DURUNIT(SECONDS)
00010000"
>L> "30"
>F> " OPTIONS DURUNIT(SECONDS) ACTION(REPLACE)
00010000"
188 *-* End
***
190 *-* Address Tso "EXECIO * DISKW OPCTEMP (STEM inrec. finis"
>L> "EXECIO * DISKW OPCTEMP (STEM inrec. finis"
191 *-* if rc := 0
>V> "0"
>L> "0"
>O> "0"
193 *-* else
194 *-* say "Process completed Successfully..."
>L> "Process completed Successfully..."
Process completed Successfully...
195 *-* ADDRESS TSO "FREE FI(OPCTEMP)"
>L> "FREE FI(OPCTEMP)"
196 *-* Say Rc
>V> "0"
0
197 *-* ADDRESS TSO "FREE FI(INDS)"
>L> "FREE FI(INDS)"
198 *-* Say Rc
>V> "0"
0
199 *-* Return
179 *-* Call Copy_Pds
201 *-* Copy_pds:
***
203 *-* Address TSO "ALLOC FI(OPCTEMP) DA('"Seqfil"') SHR"
>L> "ALLOC FI(OPCTEMP) DA('"
>V> "AFXDPR.TEMP.OPC.SEQ"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ"
>L> "') SHR"
>O> "ALLOC FI(OPCTEMP) DA('AFXDPR.TEMP.OPC.SEQ') SHR"
204 *-* Address TSO "ALLOC FI(OPCTEMP2) DA('"Seqfil3"') SHR"
>L> "ALLOC FI(OPCTEMP2) DA('"
>V> "AFXDPR.TEMP.OPC(OPCTEMP)"
>O> "ALLOC FI(OPCTEMP2) DA('AFXDPR.TEMP.OPC(OPCTEMP)"
>L> "') SHR"
>O> "ALLOC FI(OPCTEMP2) DA('AFXDPR.TEMP.OPC(OPCTEMP)') SHR
"
205 *-* Address Tso "EXECIO * DISKR OPCTEMP (STEM temp1. finis"
>L> "EXECIO * DISKR OPCTEMP (STEM temp1. finis"
206 *-* Address Tso "EXECIO * DISKW OPCTEMP2 (STEM temp1. finis"
>L> "EXECIO * DISKW OPCTEMP2 (STEM temp1. finis"
207 *-* Address TSO "FREE FI(OPCTEMP2)"
>L> "FREE FI(OPCTEMP2)"
208 *-* Say Rc
>V> "0"
0
209 *-* Address TSO "FREE FI(OPCTEMP)"
***
>L> "FREE FI(OPCTEMP)"
210 *-* Say Rc
>V> "0"
0
211 *-* Return
180 *-* Return
***
|
This is the Trace output |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Any chance of a clue at least about which dataset was the problem? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
It was all the three which were locked as per TSO ISRDDN under my id and the dataset which I am using in the job is AFXDPR.TEMP.OPC(OPCTEMP) |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
I see at least 1 Pascal assignment operator (:=) where you are checking for RC = 0. In fact I see 3 - all where you are checking for RC = 0. Suggest you convert them to Rexx and then see what happens. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
premkrishnan wrote: |
Hi,
I encountered a strange problem that I wrote a rexx to copy data from one file to another and using the output I submitted a JCL but it was saying the datasets was not free.
I did a TSO ISRDDN + ENQ and saw that the dataset was locked under my id.
I Checked the return code after freeying the dataset I saw it was 0.
But why was it still holding my dataset?
Any pointers will be really helpful.
Thanks in advance. |
When you allocate the data sets as new, you are not specifying a file name (look at line 173 for an example). A file name is taken from the pool made available by your logon procedure. Later, the data set is explicitly allocated to a file, and that file is then freed, but the original allocation remains. Try allocating the new data set with a file name, and freeing that, e.g.:
Code: |
address tso "ALLOC DS("seqfil2") FI(TOOLUT1) LIKE("lib")"
address tso "FREE FI(TOOLUT1)" |
|
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Hi Nic I still wonder as there were no statements in the code but := was generated in Trace output and Akatsukami I tried your logic and it worked fine.Thanks.
Was Rexx created using Pascal or Rexx is Modified Pascal? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Possibly i misunderstand, but REXX is REXX. . .
There are many underlying "pieces" and how they were implemented has changed over time. I've heard of pl/i, assembler, paschal, and C pieces. I have no idea which is which these days. . . If you look at the rexx executables, you may learn more. Try AMBLIST. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
as far as I can see REXX is written in PL/AS , probably with some plain assembler too. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
premkrishnan wrote: |
Was Rexx created using Pascal or Rexx is Modified Pascal? |
No; in fact, Mike Cowlishaw (originator of Rexx) wrote it assembler and drew his inspiration from PL/I (there are still a lot of similarities, although there are also enough differences to trip up the unwary). |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Got lot of things to google out
Thanks all I alwanted to be part of language developing team and I very well know I am very far away in doing that but wish I could be |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Patience
Opportunities for working on things like this are rather few, but if this is what you are interested in, let your managers know. There might not be exactly what you want at this organization, but you might get to work on things more like it.
If you don't have a dream / goal, it is much harder to get there |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Thanks Dick |
|
Back to top |
|
|
|