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: 2025
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 3 Tue Jan 17, 2017 4:26 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm


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