View previous topic :: View next topic
|
Author |
Message |
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
Code: |
01 ORD-RECORD.
05 ORD-DATE.
10 ORD-MONTH PIC XX.
10 ORD-DAY PIC XX.
10 ORD-YEAR PIC XX.
05 ORD-PART PIC 9(11).
05 ORD-QTY PIC 9(4).
05 ORD-COST PIC 9(3)V99. |
Question: For the order file described above, where must ORD-DATE be reformatted to include the correct century so it can be sorted in ascending sequence using an internal sort?
Choice 1 Before the SORT command
Choice 2 In the INPUT PROCEDURE
Choice 3 In the OUTPUT PROCEDURE
Choice 4 Before the GIVING clause
Choice 5 Before the USING clause
The 2nd Question(It has no relationship with the first question.)
Which one of the following ORDER-DATE formats can be sorted in the shortest time?
Choice 1 05 ORDER-DATE PIC S9(9) PACKED-DECIMAL VALUE 20000204.
Choice 2 05 ORDER-DATE PIC X(10) VALUE '02/04/2000'.
Choice 3 05 ORDER-DATE PIC S9(9) BINARY VALUE 20000204.
Choice 4 05 ORDER-DATE PIC 9(8) VALUE 20000204.
Choice 5 05 ORDER-DATE PIC S9(9) VALUE 20000204. |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
hi frnd,
For question one hope Choice 1 will do.
For question two Choide 3 will work.
check it and let me know |
|
Back to top |
|
|
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
khamarutheen wrote: |
hi frnd,
For question one hope Choice 1 will do.
For question two Choide 3 will work.
check it and let me know |
Sorry, I have no answer... |
|
Back to top |
|
|
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
khamarutheen wrote: |
hi frnd,
For question one hope Choice 1 will do.
For question two Choide 3 will work.
check it and let me know |
Sorry, I have no answer...
But my answer to the two questions is 4 and 4. |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
hi frnd,
Can u explain clearly about this:
For the order file described above, where must ORD-DATE be reformatted to include the correct century so it can be sorted in ascending sequence using an internal sort?
actually what u mean for.. either sorting by year or by anything else
and since binary values are more easy for the sytem to manipulate or to perform i had said choice 3 for the second question. check it. |
|
Back to top |
|
|
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
khamarutheen wrote: |
hi frnd,
Can u explain clearly about this:
For the order file described above, where must ORD-DATE be reformatted to include the correct century so it can be sorted in ascending sequence using an internal sort?
actually what u mean for.. either sorting by year or by anything else
and since binary values are more easy for the sytem to manipulate or to perform i had said choice 3 for the second question. check it. |
I think what you explain is right.
The 2nd question, I know binary values are more efficient when manipulate, but just now I am wondering whether it need to manipulate when SORT. I think you are right.
Thanks khamarutheen. |
|
Back to top |
|
|
|