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
 

 

Rexx: Getting error message FILE SCANIN2 NOT UNALLOCATED, DA

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

New User


Joined: 10 Sep 2008
Posts: 11
Location: Chennai - India

PostPosted: Thu May 21, 2009 4:14 pm    Post subject: Rexx: Getting error message FILE SCANIN2 NOT UNALLOCATED, DA
Reply with quote

Im getting the message FILE SCANIN2 NOT UNALLOCATED, DATA SET IS OPEN when the below code is trying to allocate the variable second time in loop.

"ALLOC DA("JOBPDS") F(SCANIN2) SHR REUSE"
"EXECIO * DISKR SCANIN2 (STEM INREC2."


Code:
Code:

"ALLOC DA('"JOBNAMES"') F(SCANIN1) SHR REUSE"     
"ALLOC DA('"OUTPUT"') F(SCANOUT) SHR REUSE"       
"EXECIO * DISKR SCANIN1 (STEM INREC1."           
    IF INREC1.0 > 0 THEN DO JOBNUM = 1 TO INREC1.0
     JOB = STRIP(INREC1.JOBNUM)                   
     JOBPDS = "'" || INPDS || "(" || JOB || ")'" 
     "ALLOC DA("JOBPDS") F(SCANIN2) SHR REUSE"   
     "EXECIO * DISKR SCANIN2 (STEM INREC2."       
     QUEUE INREC1.JOBNUM                         
        IF RC > 2 | INREC2.0 == 0 THEN LEAVE     
          DO I = 1 TO INREC2.0                   
              IF POS(SEARCH1,INREC2.I) <> 0 THEN DO                   
                 POS1 = POS(SEARCH1,INREC2.I)                         
                    IF POS1 <> 0 THEN DO                             
                       SUBSTRING = SUBSTR(INREC2.I,POS1+4,9)         
                          PROCNAME = "           " || STRIP(SUBSTRING)
                          QUEUE PROCNAME                             
                    END                                               
                NEW = QUEUED()                                       
              END /*IF*/                                             
           END /*DO SEARCH FOR ONE JOB*/                             
 END /*DO SEARCH ALL JOBS*/                                           
         NEW = QUEUED()                                               
         "EXECIO 0 DISKR SCANIN2 (FINIS"                             
         "EXECIO 0 DISKR SCANIN1 (FINIS"                             
         "EXECIO" NEW "DISKW SCANOUT"                                 
         "EXECIO 0 DISKW SCANOUT (FINIS"                             
         "FREE F(SCANIN1)" 
         "FREE F(SCANIN2)"
    "FREE F(SCANOUT)"       

Please help me.
Back to top
View user's profile Send private message

Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2060
Location: Silicon Valley

PostPosted: Thu May 21, 2009 9:36 pm    Post subject: Reply to: Rexx: Getting error message FILE SCANIN2 NOT UNALL
Reply with quote

Move your finis so that it is within the loop:
Code:
"EXECIO 0 DISKR SCANIN2 (FINIS"


The finis is the one that closes the file.
Back to top
View user's profile Send private message
leninmathangi

New User


Joined: 10 Sep 2008
Posts: 11
Location: Chennai - India

PostPosted: Fri May 22, 2009 11:25 am    Post subject:
Reply with quote

Thank you Pedro. It worked fine.
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 Iterative use of a REXX script causin... bryonyh CLIST & REXX 2 Fri Jul 28, 2017 12:52 pm
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am


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