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

What does the alternate sequence Sort Parameter does?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Wed May 09, 2007 9:01 pm
Reply with quote

Hi all,

In the below JCL what does the alternate sequence does? and what is the function of that here? why we need to specify the values and what are the functional work of it? Can any one clear me out in simple words with quick ref??? icon_cry.gif
Code:

//STEP0050 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN5,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
  SORT  FIELDS=(5,3,AQ,A)
  ALTSEQ CODE=(6141,6242,6343,6444,6545,6646,6747,6848,6949,
              6A4A,6B4B,6C4C,6D4D,6E4E,6F4F,7050,7151,7252,
              7353,7454,7555,7656,7757,7858,7959,7A5A)
/*
//*
icon_cry.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed May 09, 2007 9:52 pm
Reply with quote

It collates X'61'-X'7A' the same as X'41'-X'5A'.

For example, if you had these hex values in positions 5-7:

410000
610001
410002
610003

SORT FIELDS=(5,3,CH,A) would give you this output:

410000
410002
610001
610003

because X'41' collates before X'61'.

But with SORT FIELDS=(5,3,AQ,A) and the ALTSEQ statement, you would get this output:

410000
610001
410002
610003

because X'41' and X'61' collate the same.

As for why the job was set up to do that, you'd have to ask whoever set it up. Nothing special springs to mind about those particular hex values and why they would need to be collated the same.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed May 09, 2007 10:23 pm
Reply with quote

Frank Yaeger wrote:
Nothing special springs to mind about those particular hex values and why they would need to be collated the same.
Upper and lower case ASCII alphabet.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Wed May 09, 2007 10:49 pm
Reply with quote

Frank,


Quote:
But with SORT FIELDS=(5,3,AQ,A) and the ALTSEQ statement, you would get this output:

410000
610001
410002
610003


So as it returns the same why should we need to use ALTSEQ? In which scenario it will be helpful?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 09, 2007 11:56 pm
Reply with quote

Hello,

Is this accurate?
Quote:
So as it returns the same why should we need to use ALTSEQ?


Notice that with and without ALTSEQ, the output is not in same sequence.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu May 10, 2007 1:37 am
Reply with quote

Quote:
Upper and lower case ASCII alphabet.


Ah, thanks William, that makes sense (I only think in EBCDIC). icon_lol.gif

So it's collating the lowercase and uppercase ASCII letters as the same.

Thus, for example, bBAa will collate as AabB instead of ABab.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Thu May 10, 2007 4:56 pm
Reply with quote

Hi,

As frank says the below as input and
Quote:

For example, if you had these hex values in positions 5-7:

410000
610001
410002
610003


And now given as the following output i guessed both are same!!! icon_redface.gif
Quote:

SORT FIELDS=(5,3,CH,A) would give you this output:

410000
410002
610001
610003

because X'41' collates before X'61'.

But with SORT FIELDS=(5,3,AQ,A) and the ALTSEQ statement, you would get this output:

410000
610001
410002
610003
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 -> DFSORT/ICETOOL

 


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