Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Two questions about SORT.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Two questions about SORT.
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: 680
Location: NJ

PostPosted: Mon Nov 21, 2005 3:15 pm    Post subject: Reg: Sort
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    Post subject: Re: Reg: Sort
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    Post subject: Re: Reg: Sort
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: 680
Location: NJ

PostPosted: Mon Nov 21, 2005 3:43 pm    Post subject: Sort
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    Post subject: Re: Sort
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us