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

Way to remove the quotes from the records


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
scorp_rahul22
Currently Banned

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Tue Jan 01, 2008 4:34 pm
Reply with quote

/*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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jan 01, 2008 8:50 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jan 02, 2008 3:39 pm
Reply with quote

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
View user's profile Send private message
scorp_rahul22
Currently Banned

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Thu Jan 03, 2008 5:44 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 03, 2008 6:13 pm
Reply with quote

Quote:
can u plz help


You already got all the help You needed,
Just pay more attention when reading the replies
Back to top
View user's profile Send private message
scorp_rahul22
Currently Banned

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Thu Jan 03, 2008 6:28 pm
Reply with quote

I am not getting desired result , thats why i am asking again.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 03, 2008 6:41 pm
Reply with quote

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
View user's profile Send private message
scorp_rahul22
Currently Banned

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Thu Jan 03, 2008 6:43 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 03, 2008 6:53 pm
Reply with quote

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
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 Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Remove leading zeroes SYNCSORT 4
No new posts Help in extracting data between doubl... DFSORT/ICETOOL 5
Search our Forums:

Back to Top