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
 

 

Group while keeping order same

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sandy0407

New User


Joined: 01 Aug 2010
Posts: 7
Location: Morley

PostPosted: Mon Aug 02, 2010 2:11 am    Post subject: Group while keeping order same
Reply with quote

Hi,

I have the following requirement.

I have a sequential file of length 10. The first seven digits are account numbers.The file has duplicate account numbers. However, the last 3 digits are different for the records.

The input file is as shown:

7046000034AAA
7046000034CCC
7045555555FFF
7046000034BBB
7044444444DDD

I want the output to show the following:

7044444444DDD
7045555555FFF
7046000034AAA
7046000034CCC
7046000034BBB

When I sorted on account numbers in ascending order, the values for account number 7046000034 is coming in order AAA, BBB and then CCC. I want to keep the order as (AAA,CCC,BBB). I am not sure if I can use ICETOOL with select option and then use the word keepbase. Please advise.


Regards,
Sandy.
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Mon Aug 02, 2010 4:04 am    Post subject:
Reply with quote

Sandy,
Use OPTION EQUALS, it specifies that the original sequence must be preserved.

Code:
OPTION EQUALS
SORT FIELDS=(1,7,ZD,A)


Output

Code:

7044444444DDD
7045555555FFF
7046000034AAA
7046000034CCC
7046000034BBB



Thanks,
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon Aug 02, 2010 4:37 am    Post subject:
Reply with quote

Frank/Kolusu,

if there is no sign-bits involved with numbers, I always define the field as CH.
I would have used the following:
SORT FIELDS=(1,7,CH,A)

is there any advantage to using a numeric unsigned datatype in the sort parm? i.e. UFF or BI over CH

is there any disadvantage to using numeric signed datatype for unsigned data? i.e. ZD when there is no sign?
Back to top
View user's profile Send private message
sandy0407

New User


Joined: 01 Aug 2010
Posts: 7
Location: Morley

PostPosted: Mon Aug 02, 2010 5:46 am    Post subject: Reply to: Group while keeping order same
Reply with quote

I will try this option. Thank you.

Cheers,
Sandy.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Mon Aug 02, 2010 6:13 am    Post subject:
Reply with quote

Dick Brenholtz,

Just for the clarification on my proposed solution, OP said

Quote:
The first seven digits are account numbers.


Since she/he mentioned digits, I have used ZD in solution.

Thanks,
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon Aug 02, 2010 4:02 pm    Post subject:
Reply with quote

Commonly Used Data Formats
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Aug 02, 2010 10:57 pm    Post subject:
Reply with quote

Quote:
is there any advantage to using a numeric unsigned datatype in the sort parm? i.e. UFF or BI over CH

is there any disadvantage to using numeric signed datatype for unsigned data? i.e. ZD when there is no sign?


In general, for unsigned data, BI is the most efficient format. CH is equivalent to BI as long as options like LOCALE and CHALT are not in effect. ZD is not as efficient as BI or CH. UFF is not as efficient as ZD.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon Aug 02, 2010 11:29 pm    Post subject:
Reply with quote

thx Frank
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Need Help with : IFTHEN(WHEN=GROUP) Sumanta_89 DFSORT/ICETOOL 1 Wed Apr 19, 2017 5:23 pm
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am
No new posts Why TS/OP would Not contact site supp... RahulG31 All Other Mainframe Topics 4 Wed Mar 22, 2017 7:46 am


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