View previous topic :: View next topic |
Author |
Message |
cyberuser Beginner
Joined: 15 Oct 2005 Posts: 29 Topics: 12
|
Posted: Thu May 18, 2006 2:20 am Post subject: stem logic |
|
|
Hello,
i have a file with 200.000 recs, and after read it, i would like to remove the recs by a certain criteria. Could someone pls provide me a sample code how this can be acquired by use of REXX ?
the code below would drop all lines after list.100
and the desired would be : list.1 ... list.99 then list.101...
DO A=1 TO LIST.0
IF LIST.A = 100 THEN DROP LIST.A
END
is the use of STEM for this problem a good idea? |
|
Back to top |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Thu May 18, 2006 6:29 am Post subject: |
|
|
a stem with 200000 items? IMHO are too much items... what about your region memory? |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Thu May 18, 2006 6:37 am Post subject: |
|
|
cyberuser,
Using Stem for this case is not a good idea. Instead, you can read your input file record by record using DISKR until RC = 2 (End of file). You can then check your input record for any condition and drop it if required. Else write it to your output file.
The other best alternative, would be to use utilities like SORT / FILEAID to delete only those records that you do not want.
Please provide us with complete information about your input file like LRECL, RECFM and the Criteria on which you drop the record. Do you just want to delete record # 100 or is there any other drop criteria ?
Thanks,
Phantom |
|
Back to top |
|
 |
|
|