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: 2086
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

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