View previous topic :: View next topic |
Author |
Message |
kingo Intermediate
Joined: 01 Sep 2006 Posts: 167 Topics: 40 Location: chennai
|
Posted: Fri May 04, 2007 5:57 am Post subject: REXX to compare files |
|
|
Hi,
I am new to rexx can any one help me compare two files using REXX.
Regds,
Kingo _________________ IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE. |
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Fri May 04, 2007 6:00 am Post subject: |
|
|
Why not use the IBM utility SUPER-C - usually option 3.12
It saves reinventing the wheel. _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
|
kingo Intermediate
Joined: 01 Sep 2006 Posts: 167 Topics: 40 Location: chennai
|
Posted: Fri May 04, 2007 6:04 am Post subject: |
|
|
I know that option.But want to know it in develop my skills in REXX thats why.
Regds,
Kingo _________________ IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE. |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri May 04, 2007 7:06 am Post subject: |
|
|
Depends how you want to compare...A simple way is
read a record from file a
read a record from file b
do while more records on file a and file b
if file a record = file b record
then say records match
else say records do not match
read record from file a
read record from file b
end
But if you want to learn Rexx then do it yourself - you will learn better. There is plenty of reasonable documentation around and some books and sample you can look at. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
acevedo Beginner
Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Fri May 04, 2007 7:11 am Post subject: |
|
|
even though I'm agree with expat...don't reinvent the wheel, learn to use the proper language/utility for a given task.
Rexx is very easy to learn... search for examples here in this forum... there are lots of them (search for execio to read files, Do while to loop an so...).
|
|
Back to top |
|
|
kingo Intermediate
Joined: 01 Sep 2006 Posts: 167 Topics: 40 Location: chennai
|
Posted: Fri May 04, 2007 8:39 am Post subject: |
|
|
I am facing one more problem.I wrote one REXX trying access one table.I am getting -805
Regds,
Kingo _________________ IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE. |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri May 04, 2007 8:55 am Post subject: |
|
|
what is -805? Have you read up on it? Have you checked your code with reference to what the message refers to?
And this is a different problem so should be a different thread. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri May 04, 2007 11:23 am Post subject: |
|
|
I have to respectfully disagree with the other responders. I think writing a compare utility is an excellent way to learn Rexx. Who cares if you re-invent the wheel? Everyone who learns recursion, for example, reinvents the algorithm for Fibonacci numbers, and reinvents the Tower of Hanoi game. Everyone who learns a new programming language reinvents the "hello world" program. It'd be wrong to say that because there are already programs that say hello world or solve the Tower of Hanoi problem, that students should never do that again.
The reason a compare utility is such a good choice is that it takes you through most of the steps that Rexx programs use:
- Start with doing I/O to read the files.
- Learn to use stem variables for records and as associative arrays
- Learn the various operators for comparison.
- Learn the built in function for string handling to find and display differences.
- Create functions to do special manipulations like creating report sections.
- Once a basic Rexx implementation of compare is done, move on to invoking other utilities like SuperC, or Sort or others. That will teach you how to use DDNames, external programs and parameter passing in Rexx and eventually, hopefully, will teach you that all these people who keep asking how to do bizzare things using JCL should be using Rexx instead.
|
|
Back to top |
|
|
acevedo Beginner
Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Fri May 04, 2007 4:26 pm Post subject: |
|
|
yes, maybe (sure!) you're right, reinventing the wheel is good just for the experience/knowlege that you get in the process, BUT if you're not a beginner I still think that it's really important, as I said, to know what tool use for a given task.
|
|
Back to top |
|
|
|
|