View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Dear Experts,
My rquirement is as follows:
I/P File Length = 65
O/P File Length = 65
Targeted Column position (tcol) = 45 to 48 (4 char)
If the value in targeted column = 'AB '
then change it to 'ABCD'
all the other records remain constant.
I wrote the sort card as follows:
Code: |
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(45,4,CH,EQ,C'AB '),OVERLAY=(45:C'ABCD')) |
With the above sort card, I achieved my desired output file.
But please advice whether this sort card is efficient or is there any other way to write the same in performance point of view. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you run a simple experiment of
1. a copy with no overlay
2. the same copy with the overlay
The resources required will be very similar. . . |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
mkk157 wrote: |
But please advice whether this sort card is efficient or is there any other way to write the same in performance point of view.
|
This looks straight forward.
Does your job is taking longer time?
if so how many records job is processing? |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi Dick / Sambhaji,
Yes. File contains 20 Million records.
Without Overlay command, its taking 55 sec.
With Oerlay command, its taking 2.28 sec |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
I don't have any good reasons but can you give stats for this..
Code: |
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(45,4,CH,EQ,C'AB '),OVERLAY=(47:C'CD')) |
Some shooting practice in air |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Without Overlay command, its taking 55 sec.
With Oerlay command, its taking 2.28 sec |
Typo?
What are these "times"? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
IFTHEN and OVERLAY do add CPU time. That's the "penalty" you pay for "doing something".
Things you could try to possibly reduce the CPU time (although you won't know without trying them):
Use INREC instead of OUTREC
Use BUILD instead of OVERLAY
You could also try NOT using IFTHEN and instead just use CHANGE and NOMATCH without IFTHEN. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Frank,
Quote: |
IFTHEN and OVERLAY do add CPU time. That's the "penalty" you pay for "doing something". |
Which is why i guessed there might be a typo with the "stats". . .
Maybe some clarification will be posted? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Dick,
I just assumed he meant 55 sec and 2.28 min. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi Dick & Frank,
I'm sorry for not posting. Yesterday, I was not online
Without Overlay command, its taking 55 sec.
With Oerlay command, its taking 2.28 min |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Thank you for the clarification
d |
|
Back to top |
|
|
|