IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Not Able to find the bug.


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 26, 2009 12:24 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 26, 2009 12:46 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 26, 2009 12:56 pm
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
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 26, 2009 1:08 pm
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: 8797
Location: Welsh Wales

PostPosted: Thu Mar 26, 2009 1:12 pm
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
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Mar 26, 2009 1:19 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 26, 2009 1:19 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
No new posts Find a record count/numeric is multip... COBOL Programming 1
No new posts Need to find a specific STRING COBOL Programming 11
Search our Forums:

Back to Top