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
 

 

Not Able to find the bug.

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

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Thu Mar 26, 2009 11:00 am    Post subject: Not Able to find the bug.
Reply with quote

Hi Following is my code
Code:

 ARG YEAR DAY SRAO BRAO INVT                                       
     DATASET="TOLLNA.T.G861000.G8610A11.WCOGET.C"YEAR""DAY"01"     
     "ALLOC DA('"DATASET"') F(INPUT) SHR REUSE"                     
     'EXECIO * DISKR INPUT (STEM LINES. OPEN'                       
       COUNT = LINES.0 ; I = 0 ; START=0 ; STOP=0                   
        DO UNTIL I > COUNT                                         
          REC=LINES.I                                               
          PARSE VAR REC A 13 INV 15 GAR 20 RAO1 23 RAO2 26         
          IF INV = INVT & RAO1 = SRAO & RAO2 = BRAO THEN           
          DO                                                       
              IF START = 0 THEN                                     
              DO                                                   
                 START = I                                         
              END                                                   
              ELSE                                                 
              DO                                                   
                 STOP = I                                           
              END                                                   
          END                                                       
          I=I+1                                                     
        END                                                         
       /**************************************************/         
 DO UNTIL STOP < START                                               
 QUEUE LINES.START                                                   
 START = START + 1                                                   
 END                                                                 
 DATASET1="TOLLNA.T.SRAO"SRAO".BRAO"BRAO".C"YEAR""DAY"01"           
 "ALLOC DA('"DATASET1"') F(MYOUTDD) LIKE('"DATASET"') NEW REUSE"     
 "EXECIO * DISKW MYOUTDD (FINIS"                                     
 "EXECIO * DISKR INPUT (FINIS"                                       
       /***************************************************/         
 BRAO = 0 ; SRAO = 0                                                 
 EXIT   


i am running this code 31 times using another REXX program. For the First run it gives " FILE INPUT NOT UNALLOCATED, DATA SET IS OPEN "
and the file gets created by no data and the rest 30 files are created with correct and properly data.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Mar 26, 2009 12:24 pm    Post subject: Reply to: Not Able to find the bug.
Reply with quote

since You are reading the whole file into a stem

substitute
Code:
"EXECIO * DISKR INPUT (STEM LINES. OPEN"


with
Code:
"EXECIO * DISKR INPUT (STEM LINES. FINIS"


and get rid of
Code:
"EXECIO * DISKR INPUT (FINIS"
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Thu Mar 26, 2009 12:28 pm    Post subject:
Reply with quote

Still the same error message is comming "FILE INPUT NOT UNALLOCATED, DATA SET IS OPEN" for the first run rest are working fine
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Mar 26, 2009 12:46 pm    Post subject: Reply to: Not Able to find the bug.
Reply with quote

run with "TRACE A" to see at what point You get the message
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Thu Mar 26, 2009 12:49 pm    Post subject:
Reply with quote

I am getting the error messg after the code
"ALLOC DA('"DATASET"') F(INPUT) SHR REUSE"
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Mar 26, 2009 12:56 pm    Post subject: Reply to: Not Able to find the bug.
Reply with quote

looks like You did not tell everything
You have a previous process on the same dataset pending
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Thu Mar 26, 2009 1:05 pm    Post subject:
Reply with quote

No, from the calling program i am processesing another dataset and from that i am retrieving relevant data. And then i am calling the above program with those relevant data i am creating the new datasets using the input dataset.

While in the whole process the error is coming when i am allocating "ALLOC DA('"DATASET"') F(INPUT) SHR REUSE" for the first time only rest 30 loops are running fine and all new datasets are created with proper data.
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Thu Mar 26, 2009 1:07 pm    Post subject:
Reply with quote

Also when i am removing the ARG keyword and inputing the data manually the program is running fine and the new data set is created.

If you want code of the calling program i can provide you with that also.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Mar 26, 2009 1:08 pm    Post subject: Reply to: Not Able to find the bug.
Reply with quote

try to run without the REUSE, even if I doubt that it would be useful

if the system tells that a dataset is open I tend to trust it
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 26, 2009 1:12 pm    Post subject:
Reply with quote

Just another little possibility ............

Are you using F(INPUT) for any other dataset being processed but not shown in the code snippet supplied.
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Thu Mar 26, 2009 1:13 pm    Post subject:
Reply with quote

Even i can not Belive that it says "FILE INPUT NOT UNALLOCATED, DATA SET IS OPEN" it is the first run according to my logic.

I tried it by removing the "REUSE" then none of the data set is written insted it gives message "FILE INPUT NOT UNALLOCATED, DATA SET IS OPEN" for all the loops .... icon_cry.gif
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Thu Mar 26, 2009 1:16 pm    Post subject:
Reply with quote

Yeah i am using F(INPUT) but it is in the calling program.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 26, 2009 1:19 pm    Post subject:
Reply with quote

See what happens if you sue perhaps F(INPUT2) instead
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Mar 26, 2009 1:19 pm    Post subject: Reply to: Not Able to find the bug.
Reply with quote

change the ddname then !
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Thu Mar 26, 2009 1:20 pm    Post subject:
Reply with quote

Its working, when i changed the F(INPUT) to F(INPUT1) in the called program ..... icon_lol.gif

Thanks for Your Support ...
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 How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm
No new posts how to find clist's or view library Andrew Hsia CLIST & REXX 4 Tue Jun 28, 2016 6:07 pm
No new posts How to find jobs that are in schedule... anilkumar922 All Other Mainframe Topics 5 Tue Jun 28, 2016 10:01 am


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