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

Sorting order - performing Reverse Action


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1788
Location: Bloomington, IL

PostPosted: Sun Mar 10, 2013 12:09 am
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
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

Superior Member


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

PostPosted: Sun Mar 10, 2013 12:28 am
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: 1788
Location: Bloomington, IL

PostPosted: Sun Mar 10, 2013 12:34 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Rotate partition-logical & physic... DB2 0
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts DB2 Load - Sort Or order BY DB2 1
No new posts Sorting a record spanned over multipl... DFSORT/ICETOOL 13
No new posts Cobol-DB2 Programming - Better perfor... DB2 1
Search our Forums:

Back to Top