Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2104
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 Error executing Java program in OSGI ... danik56 CICS 0 Thu Apr 26, 2018 12:16 am
This topic is locked: you cannot edit posts or make replies. GDG gen check using REXX raghuraman123 CLIST & REXX 6 Wed Apr 18, 2018 9:18 pm
No new posts IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts 3270 Data stream error Benchwarmer CICS 6 Tue Apr 17, 2018 12:06 am
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us