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

How to determine whether a dataset is sorted or not?


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

New User


Joined: 16 Sep 2005
Posts: 2

PostPosted: Fri Sep 16, 2005 11:22 am
Reply with quote

Hi all

I'd like to know if/how it is possible to use DFSORT/ICETOOL to just determine if a dataset is sorted or not, and then give a suitable returncode. I'd like to invoke the sort from JCL.

regards

Killer
Back to top
View user's profile Send private message
mallikiran

New User


Joined: 07 Sep 2005
Posts: 49

PostPosted: Fri Sep 16, 2005 9:12 pm
Reply with quote

Sort the input file in the order you expect it be sorted and then compare the original file and sorted file using SUPERC. SUPERC reports differences even if the order of the records are different.
If RC=1, then the input file was not sorted, if RC=0, then the input file was sorted.
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Sun Sep 18, 2005 2:08 pm
Reply with quote

Killer,

If the file is sorted you will have RC=0, if not RC=16
Code:

//STEP0001 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*     
//SORTOUT  DD SYSOUT=*     
//SORTIN01 DD *           
02                         
03                         
01                         
/*                         
//SYSIN DD *               
  MERGE FIELDS=(1,2,ZD,A) 
/*

Alain
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top