Page 1 of 1

What is the meaning of Using class on Sort statement ?

PostPosted: Tue Jun 01, 2010 11:52 am
by diptisaini
READ WORK FILE 2 RECORD #CW0002L1-WORK-RECORD
END-ALL
SORT BY #CW0002L1-CA-TYPE #CW0002L1-CA-NO
#CW0002L1-CUST-NO
#CW0002L1-SAFEKEEP-ACCT #CW0002L1-NOM-SUB
#CW0002L1-ASSET-ID
USING #CW0002L1-HOLDING-DATE #CW0002L1-AWAITING-DELIVERY
#CW0002L1-AWAITING-RECEIPT #CW0002L1-IN-DEPOSIT
#CW0002L1-AT-VAULT #CW0002L1-TRADING-POSITION
#CW0002L1-AT-REGISTRAR
End-SORT.

Can anyone tell me what is the use of end-all statement and also how this sort statement will work?

Re: What is the meaning of Using class on Sort statement ?

PostPosted: Tue Jun 01, 2010 7:50 pm
by RGZbrog
END-ALL is well documented in the Statements manual: http://documentation.softwareag.com/nat ... m/sort.htm. What don't you understand?

The keys and the fields in the USING clause are combined to create the SORT record. They are passed to and from the SORT utility. On the first iteration of the SORT loop, the values of all other local variables are unknown.