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
 

 

Sorting order - performing Reverse Action

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

New User


Joined: 13 May 2010
Posts: 16
Location: hyderabad

PostPosted: Sat Mar 09, 2013 11:59 pm    Post subject: Sorting order - performing Reverse Action
Reply with quote

Hi ,

I want to do a sort an I/P file on first 12 bytes ,
when i am giving the SORT FIELDS=(1,12,CH,A) ,
the ouput is coming in descending order instead of ascending.
and when i am giving the SORT FIELDS=(1,12,CH,D) ,
the output is coming in Ascending order.

i am not able to find the cause of this reverse action.
Please help.

Below is the data of I/P file and sorted output file

INP file
11A019744400
11A023666500
11A025620401
11A035790200

SORT CARD

//SYSIN DD *
SORT FIELDS=(1,12,CH,A)
/*
//*

sorted file output
11A035790200
11A025620401
11A023666500
11A019744400

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

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1770
Location: Bloomington, IL

PostPosted: Sun Mar 10, 2013 12:09 am    Post subject:
Reply with quote

Use Code tags.

What is the record format (RECFM) of your input data set?
Back to top
View user's profile Send private message
avinash sengar

New User


Joined: 13 May 2010
Posts: 16
Location: hyderabad

PostPosted: Sun Mar 10, 2013 12:22 am    Post subject:
Reply with quote

RECFM is VB

Below is the code i ran

Code:
//JS080   EXEC PGM=SORT                                         
//SYSOUT   DD  SYSOUT=(,)                                       
//SORTIN   DD  DSN=T4053.DA.I259BA.CSPCMS.HOSP837.CLAIM,DISP=SHR
//SORTOUT  DD  DSN=T4053.DA.I259BA.CSPCMS.HOSP837.CLMSORT,       
//             DISP=(NEW,CATLG,DELETE),UNIT=DISK,               
//             DCB=(RECFM=VB,LRECL=2382,BLKSIZE=0),             
//             MGMTCLAS=AMLYBW,SPACE=(TRK,(0500,500),RLSE)       
//SORTWK01 DD  UNIT=DISK,SPACE=(CYL,(100,50),RLSE)               
//SORTWK02 DD  UNIT=DISK,SPACE=(CYL,(100,50),RLSE)               
           
//SYSIN    DD  *                                                 
  SORT FIELDS=(1,12,CH,A)                                       
/*                                                               
//*         



Thanks!!



Edited to add code tags.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sun Mar 10, 2013 12:28 am    Post subject:
Reply with quote

As Akatsukami has correctly guessed, Try:
Code:
//SYSIN DD *
SORT FIELDS=(5,12,CH,A)
/*

However, per the data you show, is the file a "real VB"?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1770
Location: Bloomington, IL

PostPosted: Sun Mar 10, 2013 12:34 am    Post subject:
Reply with quote

avinash sengar wrote:
RECFM is VB

Below is the code i ran

//JS080 EXEC PGM=SORT
//SYSOUT DD SYSOUT=(,)
//SORTIN DD DSN=T4053.DA.I259BA.CSPCMS.HOSP837.CLAIM,DISP=SHR
//SORTOUT DD DSN=T4053.DA.I259BA.CSPCMS.HOSP837.CLMSORT,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// DCB=(RECFM=VB,LRECL=2382,BLKSIZE=0),
// MGMTCLAS=AMLYBW,SPACE=(TRK,(0500,500),RLSE)
//SORTWK01 DD UNIT=DISK,SPACE=(CYL,(100,50),RLSE)
//SORTWK02 DD UNIT=DISK,SPACE=(CYL,(100,50),RLSE)

//SYSIN DD *
SORT FIELDS=(1,12,CH,A)
/*
//*



Thanks!!

So you didn't realize that your sort product would sort the record descriptor word (RDW) before your intended key? Begin by changing your sort card to be
Code:

  SORT FIELDS=(5,12,CH,A)

If you still have problems, post the messages from the SYSOUT DD in Code tags.
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 Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 37 Tue Dec 06, 2016 8:04 pm
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am


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