Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
I want to replace junks in file fields with some default value. Can i accomplish this task with DFSORT options ?
Code:
example: length of input file can be 5
INPUT FILE
-------------
YAY.Y
.AYYY
Y.Y.Y
YA..Y
YRN..
assume . =junk character
I want to check for all places in records for junks like..
1) for first field in input file, i have to check ---
IF it is not 'Y' or 'N' then replace it with default value 'N'
2) for second field in input file, i have to check ---
IF it is not 'A'or 'R then replace it with default value 'R'
3) for third field in input file, i have to check ---
IF it is not 'Y'or 'N' then replace it with default value 'N'
4) for fourth field in input file, i have to check ---
IF it is not 'Y'or 'N' then replace it with default value 'N'
5) for fifth field in input file, i have to check ---
IF it is not 'Y'or 'N' then replace it with default value 'N'
OUTPUT FILE should be as below
-------------------------------------
Code:
YAYNY
NAYYY
YRYNY
YANNY
YRNNN
Let me know if we can do this with sort options/how or eazytrieve...
Which option would be better from performance point of view ?
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Quote:
this will help me to recreate file in case of any accidental damage.
If this "file" you are creating will have only specific values, how will this help recreating the file? How does a file "accidentally" get damaged so that the values can be "reset" this way
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
Skolusu, i think this optin can not check range if required..
e.g. if i want to check for one place if it is not in the range of 000 to 100 then reset to 000.
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
@Anbarasan D & @Garry Carroll
This is perfect PLUS optimized one...
Which one should be opted performancewise
1. Eazytriev or
2. given SORT
When i tried, i found both are almost equal but only few programmers who are more used to Eazytrieve, are using Eazytrieve and
those new generation who is more familer with SORT CARDs, prefers it because of many in one advantages...
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Quote:
When i tried, i found both are almost equal but only few programmers who are more used to Eazytrieve, are using Eazytrieve and
those new generation who is more familer with SORT CARDs, prefers it because of many in one advantages...
Let me know if wrong.
What do you mean "almost equal"?
If the local standards permit the use of either, then either should be ok.
From what i've seen many places, sort will perform better than Easytrieve for large volumes of data. Easytrieve is intended to be an entire programming language. I believe that neither is the tool for "everything". One should determine the better tool for the job and use that tool. Have you ever seen a master carpenter with only one saw?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
rohanthengal wrote:
Skolusu, i think this optin can not check range if required..
e.g. if i want to check for one place if it is not in the range of 000 to 100 then reset to 000.
rohanthengal,
You are provided with a solution specific to the requirements posted in your first post. We cannot read your mind or requirements. Post detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.
Please Seek solutions instead of Shopping for solutions.