This sample DDS shows a unique feature of logical files, the ability to create derived fields from existing physical file fields. The key structure also makes use of the DESCEND keyword arranging the key in descending sequence.

************** Beginning of data ****************************
A          R GPORTA                    PFILE(GPORTAFL)   
A            COMPNZ    R                                 
A            INVNOZ    R                                 
A            CSTNOZ    R                                 
A            SLSNOZ    R                                 
A            ORQTYZ    R                                 
A            WHSNOZ    R                                 
A            SLPRCZ    R                                 
A            SPCD1Z    R                                 
A            SHPVAZ    R                                 
A            TERMSZ    R                                 
A            CATGYZ    R                                 
A            VOLMNZ    R                                 
A            ZONE1Z    R                                 
A            FRAMTZ    R                                 
A            QTYSHH    R                                 
A            ENTDTZ    R     S                           
A            YEARAZ             I      SST(ENTDTZ 5 4)                                                            
A            MONTAZ             I      SST(ENTDTZ 1 2) 
A            DAYEAZ             I      SST(ENTDTZ 3 2) 
A            SSDATZ    R     S                         
A            YEARBZ             I      SST(SSDATZ 5 4) 
A            MONTBZ             I      SST(SSDATZ 1 2) 
A            DAYEBZ             I      SST(SSDATZ 3 2) 
A            INVDTZ    R     S                         
A            YEARCZ             I      SST(INVDTZ 5 4) 
A            MONTCZ             I      SST(INVDTZ 1 2) 
A            DAYECZ             I      SST(INVDTZ 3 2) 
A            TRKNOZ    R                               
A            CSTORZ    R                               
A            HOWSHZ    R                               
A            COMANZ    R                               
A            DSGVNZ    R                               
A            BOQTYZ    R                               
A            ADVALZ    R                               
A            DTSCHZ    R                               
A            FRTCDZ    R                               
A            ADVCDZ    R 
A            SHPCDZ    R
A            FSTATZ    R
A            BLFNMZ    R
A            BLLNMZ    R
A            BLAD1Z    R
A            BLAD2H    R
A            BLCTYZ    R
A            BLSTAZ    R
A            BLSTAH    R
A            BLZIPZ    R
A            BLZIPH    R
A            SHPFNZ    R
A            SHPLNZ    R
A            SHPADZ    R
A            SHPA2H    R
A            SHPCTZ    R
A            SHPSTH    R
A            SHPZPH    R
A            EXTR5H    R
A            FRAMTH    R
A            DSGVNH    R                              
A            DTAADH    R     S                        
A            CYAADH             I      SST(DTAADH 5 4)
A            MMAADH             I      SST(DTAADH 1 2)
A            DDAADH             I      SST(DTAADH 3 2)
A          K COMPNZ                                   
A          K CSTNOZ                                   
A          K CYAADH                    DESCEND        
A          K MMAADH                    DESCEND        
A          K DDAADH                    DESCEND        
A          K YEARAZ                    DESCEND        
A          K MONTAZ                    DESCEND        
A          K DAYEAZ                    DESCEND