View previous topic :: View next topic
|
Author |
Message |
mpawan Warnings : 2 New User
Joined: 03 Nov 2008 Posts: 42 Location: Pune
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
mpawan Warnings : 2 New User
Joined: 03 Nov 2008 Posts: 42 Location: Pune
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
run with "TRACE A" to see at what point You get the message |
|
Back to top |
|
|
mpawan Warnings : 2 New User
Joined: 03 Nov 2008 Posts: 42 Location: Pune
|
|
|
|
I am getting the error messg after the code
"ALLOC DA('"DATASET"') F(INPUT) SHR REUSE" |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
looks like You did not tell everything
You have a previous process on the same dataset pending |
|
Back to top |
|
|
mpawan Warnings : 2 New User
Joined: 03 Nov 2008 Posts: 42 Location: Pune
|
|
|
|
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 |
|
|
mpawan Warnings : 2 New User
Joined: 03 Nov 2008 Posts: 42 Location: Pune
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
mpawan Warnings : 2 New User
Joined: 03 Nov 2008 Posts: 42 Location: Pune
|
|
|
|
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 .... |
|
Back to top |
|
|
mpawan Warnings : 2 New User
Joined: 03 Nov 2008 Posts: 42 Location: Pune
|
|
|
|
Yeah i am using F(INPUT) but it is in the calling program. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
See what happens if you sue perhaps F(INPUT2) instead |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
change the ddname then ! |
|
Back to top |
|
|
mpawan Warnings : 2 New User
Joined: 03 Nov 2008 Posts: 42 Location: Pune
|
|
|
|
Its working, when i changed the F(INPUT) to F(INPUT1) in the called program .....
Thanks for Your Support ... |
|
Back to top |
|
|
|