MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

REXX to compare files

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
kingo
Intermediate


Joined: 01 Sep 2006
Posts: 167
Topics: 40
Location: chennai

PostPosted: Fri May 04, 2007 5:57 am    Post subject: REXX to compare files Reply with quote

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
View user's profile Send private message Yahoo Messenger
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri May 04, 2007 6:00 am    Post subject: Reply with quote

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


Joined: 01 Sep 2006
Posts: 167
Topics: 40
Location: chennai

PostPosted: Fri May 04, 2007 6:04 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri May 04, 2007 7:06 am    Post subject: Reply with quote

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


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Fri May 04, 2007 7:11 am    Post subject: Reply with quote

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...).

Wink
Back to top
View user's profile Send private message
kingo
Intermediate


Joined: 01 Sep 2006
Posts: 167
Topics: 40
Location: chennai

PostPosted: Fri May 04, 2007 8:39 am    Post subject: Reply with quote

I am facing one more problem.I wrote one REXX trying access one table.I am getting -805 Sad

Regds,
Kingo
_________________
IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE.
Back to top
View user's profile Send private message Yahoo Messenger
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri May 04, 2007 8:55 am    Post subject: Reply with quote

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


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri May 04, 2007 11:23 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Fri May 04, 2007 4:26 pm    Post subject: Reply with quote

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.

Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group