IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Two questions about SORT.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sungang77

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Mon Nov 21, 2005 2:44 pm
Reply with quote

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

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Mon Nov 21, 2005 3:15 pm
Reply with quote

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

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Mon Nov 21, 2005 3:29 pm
Reply with quote

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

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Mon Nov 21, 2005 3:36 pm
Reply with quote

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

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Mon Nov 21, 2005 3:43 pm
Reply with quote

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

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Mon Nov 21, 2005 3:59 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top