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 the dataset

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

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Sep 28, 2011 8:52 pm    Post subject: Free the dataset
Reply with quote

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
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Sep 28, 2011 8:55 pm    Post subject: Re: Free the dataset
Reply with quote

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
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Sep 28, 2011 9:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Sep 28, 2011 9:37 pm    Post subject: Reply to: Free the dataset
Reply with quote

Any chance of a clue at least about which dataset was the problem?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Sep 28, 2011 9:39 pm    Post subject:
Reply with quote

It was all the three which were locked as per TSO ISRDDN under my id icon_confused.gif and the dataset which I am using in the job is AFXDPR.TEMP.OPC(OPCTEMP)
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Wed Sep 28, 2011 10:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Sep 28, 2011 10:27 pm    Post subject: Re: Free the dataset
Reply with quote

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
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Sep 29, 2011 11:31 am    Post subject:
Reply with quote

Hi Nic I still wonder as there were no statements in the code but := was generated in Trace output icon_confused.gif and Akatsukami I tried your logic and it worked fine.Thanks.

Was Rexx created using Pascal or Rexx is Modified Pascal?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Sep 29, 2011 8:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Sep 29, 2011 8:51 pm    Post subject: Reply to: Free the dataset
Reply with quote

as far as I can see REXX is written in PL/AS , probably with some plain assembler too.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Sep 29, 2011 11:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Sep 30, 2011 9:56 am    Post subject:
Reply with quote

Got lot of things to google out icon_biggrin.gif

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 icon_sad.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 30, 2011 10:20 am    Post subject:
Reply with quote

Hello,

Patience icon_smile.gif

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 icon_wink.gif
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Sep 30, 2011 11:28 pm    Post subject:
Reply with quote

Thanks Dick icon_biggrin.gif
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 FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts FTOPEN TEMP is failing due to dataset... mbenaud TSO/ISPF 7 Thu Jul 28, 2016 4:28 pm


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