skip to main content

Library Routines : C$SORT

C$SORT
The C$SORT library routine sorts indexed, relative, sequential and line sequential files. It takes only one parameter that matches with the instructions you would pass to the ISSORT (External Sort) utility on the command line.
Syntax:
 CALL "C$SORT" USING sortInstructions
Parameters:
Refer to ISSORT (External Sort) documentation for details about the allowed syntax.
Return code:
returnCode can be any numeric data item and provides additional information:
Examples:
Example - Sort the indexed file named idxfile by reading records on the primary key in descending order, discard records whose data at offset 37 length 4 bytes represents a numeric value less than 902. Save the result to a line sequential file named output.txt.
call "c$sort" using "sort fields (1, 6, ch, d) "
               & "use idxfile org ix record f 40 key (1, 6, p, 7, 15, c, 22, 15, ad) "
               & "give output.txt org ls record f 40 "
               & "include cond = 37,4,ge,902".
if return-code not = 0
   display message "Sort failed"

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left