View previous topic :: View next topic
|
Author |
Message |
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
000000010 'EWP.SQ.MB.DERVTN.TABLE.ALS' RDWDDWIS
000000011 'EWP.SQ.MB.DERVTN.TABLE.HIER' RDWDDWIS
000000013 'EWP.SQ.MB.DERVTN.TABLE.ST' RDWDDWIS
000000014 'NSP.EDW.LOADLIB' EWWM31CU
000000015 'NSP.EDW.LOADLIB' EWWM31IU
000000016 'NSP.EDW.LOADLIB' EWWM31PU
000000017 'NSP.EDW.LOADLIB' EWWM310U
000000018 'NSP.EDW.LOADLIB' EWWM312U
000000019 'NSP.EDW.LOADLIB' EWWM316U
Its not removing quotes
in the case
INPREC=STRIP(INREC.I,'L',' ');
INPREC=STRIP(INPREC,'T',' ');
J=LENGTH(INPREC)-2;
INPREC=SUBSTR(INPREC,2,J);
OUT.I=INPREC
and when i m writting
DO I=1 TO INREC.0
PARSE VAR INREC.I GARB1 "'" DATA "'" GARB2
OUT.I = DATA
it is generating empty file |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Code: |
/*REXX*/
DSN1="NBK3EYB.DSN.OUTPUT2"
"ALLOC FI(INDSN) DA('"DSN1"') SHR"
"ALLOC F(INDSN2) DA('NBK3EYB.FILE.OUTPUT.REXX') SHR";
HEAP=40000
RCODE=0;
DO UNTIL RCODE <> 0
"EXECIO "HEAP" DISKR INDSN (STEM INREC."
RCODE=RC
OUT. = ""
DO I=1 TO INREC.0
Parse Var INREC.I . "'" Data "'" .
OUT.I = Data
END
"EXECIO * DISKW INDSN2 (STEM OUT."
END
"EXECIO 0 DISKW INDSN2 (FINIS"
"FREE F(INDSN)";
"FREE F(INDSN2)";
EXIT; |
I did some tests with that rexx but I had to change from MOD to SHR in the ALLOC command because I used PDS and not DS.
I removed the FINIS in the EXECIO DISKW and placed a FINIS after the loop.
The OUT. = '' cleans the output array, it's useful when reading the last pack of records.
For cosmetics, I used placeholders (.) instead of garbage fields in the PARSE line.
It worked for me. |
|
Back to top |
|
|
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
I AM TRYING BUT THAT IS NOT WORKING IN THIS CASE ALSO
IT IS SHOWING
FILE INDSN5 NOT FREED, DATA SET IS OPEN
***
/*REXX*/
DSN1="NBK3EYB.TEMP.REXX"
"ALLOC FI(INDSN5) DA('"DSN1"') SHR"
"ALLOC F(INDSN6) DA('NBK3EYB.FILE.OUTPUT.REXX') SHR";
HEAP=40000
RCODE=0;
DO UNTIL RCODE <> 0
"EXECIO "HEAP" DISKR INDSN5 (STEM INREC."
RCODE=RC
OUT. = ""
DO I=1 TO INREC.0
PARSE VAR INREC.I . "'" DATA "'" .
OUT.I = DATA
END
"EXECIO * DISKW INDSN6 (STEM OUT."
END
"EXECIO 0 DISKW INDSN6 (FINIS"
"FREE F(INDSN5)";
"FREE F(INDSN6)";
EXIT; |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Forgot to close the input file before the FREE:
Code: |
"EXECIO 0 DISKR INDSN5 (FINIS"
"EXECIO 0 DISKW INDSN6 (FINIS"
"FREE F(INDSN5)";
"FREE F(INDSN6)";
|
|
|
Back to top |
|
|
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
/*REXX*/
DSN1="K3EYB.DSN.OUTPUT2"
"ALLOC FI(INDSN5) DA('"DSN1"') SHR"
"ALLOC F(INDSN6) DA('K3EYB.FILE.OUTPUT.REXX') SHR";
CURRENT=1
HEAP=40000
RCODE=0;
DO UNTIL RCODE <> 0
"EXECIO "HEAP" DISKR INDSN5 (STEM INREC."
RCODE=RC
DO I=1 TO INREC.0
INPREC=STRIP(INREC.I,'L',' ');
INPREC=STRIP(INPREC,'T',' ');
J=LENGTH(INPREC)-2;
INPREC=SUBSTR(INPREC,2,J);
OUT.I=INPREC
END
CURRENT=CURRENT+HEAP;
"EXECIO * DISKW INDSN6 (STEM OUT."
END
"EXECIO 0 DISKR INDSN5 (FINIS"
"EXECIO 0 DISKW INDSN6 (FINIS"
"FREE F(INDSN5)";
"FREE F(INDSN6)";
EXIT;
this is not working . its not removing the quotes |
|
Back to top |
|
|
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
/*REXX*/
DSN1="K3EYB.DSN.OUTPUT5"
"ALLOC FI(INDSN5) DA('"DSN1"') SHR"
"ALLOC F(INDSN6) DA('K3EYB.FILE.OUTPUT.REXX') SHR";
CURRENT=1
HEAP=40000
RCODE=0;
DO UNTIL RCODE <> 0
"EXECIO "HEAP" DISKR INDSN5 "CURRENT" (STEM INREC."
RCODE=RC
DO I=1 TO INREC.0
INPREC=STRIP(INREC.I,L,' ');
INPREC=STRIP(INPREC,'T',' ');
J=LENGTH(INPREC)-2;
INPREC=SUBSTR(INPREC,2,J);
OUT.I=INPREC
END
CURRENT=CURRENT+HEAP;
"EXECIO * DISKW INDSN6 (STEM OUT."
END
"EXECIO 0 DISKR INDSN5 (FINIS"
"EXECIO 0 DISKW INDSN6 (FINIS"
"FREE F(INDSN5)";
"FREE F(INDSN6)";
EXIT;
i am writting this code and this is repeating lines
suppose i have input file of 137252 records
it is showing output file of 160000 (multiple of 40000)
can u please solve this problem |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
it is conceptually WRONG to use "EXECIO * DISKW"
wise programmers ALWAYS specify the number of records to be written
there are lots of reasons to avoid the style You used..
sibce You did not drop the stem used for output the out. thing after the first full heap will chave 40000 occurrences,
at the last iteration You fill 30000 something,
but the other will still be in the variable pool, and as a consequence they will be written out |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Yesterday at 9.57 am, there was a line with OUT. = "" in the program.
At 12.40 pm, that line was gone.
This line was more or less equivalent to the DROP that enrico stated.
EXECIO * DISKW with STEM will write lines until it reaches an empty value.
If you have complete control of your variables, it will work fine.
If you're not sure, store the number of records (in OUT.0 for example).
It is a better practice, specially if you have more process on the stem variable (in that case, DO I = 1 TO OUT.0 works great) |
|
Back to top |
|
|
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
CURRENT=1
HEAP=100
RCODE=0;
DO UNTIL RCODE <> 0
DROP INREC.0
"EXECIO "HEAP" DISKR INDSN5 "CURRENT" (STEM INREC."
SAY INREC.0
RCODE=RC
DO I=1 TO INREC.0
INPREC=STRIP(INREC.I,L,' ');
INPREC=STRIP(INPREC,'T',' ');
J=LENGTH(INPREC)-2;
INPREC=SUBSTR(INPREC,2,J);
OUT.I=INPREC
END
CURRENT=CURRENT+HEAP;
"EXECIO * DISKW INDSN6 (STEM OUT."
I am writting this code but still it is going till 500 when i have only 450 records. can u plz help |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
You already got all the help You needed,
Just pay more attention when reading the replies |
|
Back to top |
|
|
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
I am not getting desired result , thats why i am asking again. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
You are not getting the desired resulst because ...
YOU DO NOT PAY ATTENTION
requoting one of my previous posts
Quote: |
t is conceptually WRONG to use "EXECIO * DISKW"
wise programmers ALWAYS specify the number of records to be written
there are lots of reasons to avoid the style You used..
since You did not drop the stem used for output
the out. thing after the first full heap will have 40000 occurrences,
at the last iteration You fill 30000 something,
but the other will still be in the variable pool, and as a consequence they will be written out |
|
|
Back to top |
|
|
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
CURRENT=1
HEAP=5
RCODE=0;
DO UNTIL RCODE <> 0
INREC.=""
"EXECIO "HEAP" DISKR INDSN5 "CURRENT" (STEM INREC."
SAY INREC.0
RCODE=RC
DO I=1 TO INREC.0
INPREC=STRIP(INREC.I,L,' ');
INPREC=STRIP(INPREC,'T',' ');
J=LENGTH(INPREC)-2;
INPREC=SUBSTR(INPREC,2,J);
OUT.I=INPREC
END
CURRENT=CURRENT+HEAP
"EXECIO * DISKW INDSN6 (STEM OUT."
END
"EXECIO 0 DISKR INDSN5 (FINIS"
i am trying with this , but same result |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I cannot do anything else but
repeat and repeat and repeat and repeat and repeat and repeat and ...
repeat and repeat and repeat and repeat and repeat and repeat and ...
repeat and repeat and repeat and repeat and repeat and repeat and ...
repeat and repeat and repeat and repeat and repeat and repeat and ...
repeat and repeat and repeat and repeat and repeat and repeat and ...
repeat and repeat and repeat and repeat and repeat and repeat and ...
repeat and repeat and repeat and repeat and repeat and repeat and ...
repeat and repeat and repeat and repeat and repeat and repeat and ...
DROP THE F*****G OUT. STEM AFTER THE EXECIO ... DISKW
OR USE "EXECIO " inrec.0 " DISKW" |
|
Back to top |
|
|
|