Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us