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: 2033
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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