Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all!
I'm having a problem with the SORT/SPEC command. I need to remove unwanted records (based on a date/time field) from a file but all input records are propagating to the output file. I could have a DCL procedure read the file, but I figured SORT would be faster. I use the command;
$sort/spec=specfile infile outfileThe input file contains:
7 district names loaded.
123456789-123456789-123456789- this line is to count columns
MIM00326004061102003030319551
MIM00326005002702003030119551
MIM00326005002702003030319551
NSI12016003001012003030320154
NSI12016009601022003030320154
SOM11323001806062003030320401
SOM11323010806072003030322444
SLM00228714001562003030320074
SLM00216006603062003030319301
NRM01224005107202003030401184
NRM01224011909132003030323564
SJC11505860405872003030316331
SJC11505862806712003030316131The specification file contains:
/field=(name=district,position:1,size:6,character)
/field=(name=unitid,position:7,size:10,character)
/field=(name=datetime,position:17,size:12,CHARACTER)
/field=(name=unitype,position:29,size:1,character)
/field=(name=today,value:"200303051200",size:12,character)
/field=(name=tomorrow,value:"200303061200",size:12,character)
/condition=(name=istoday,test=(datetime ge today))
/condition=(name=istomorrow,test=(datetime le tomorrow))
/condition=(name=nottoday,test=(datetime lt today))
/condition=(name=nottomorrow,test=(datetime gt tomorrow))
/include=(condition=istoday)
/include=(condition=istomorrow)
/omit=(condition=nottoday)
/omit=(condition=nottomorrow)I've tried the spec file with all upper case, switched "=" for ":" and no change; all input data goes to the output file. Any ideas? Thanks!
Dave

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |