Page 1 of 1

Find records with any digit followed by D

PostPosted: Wed Feb 20, 2019 8:45 pm
by RalphEagle
Dear everyone,

I have a file with records packed into the hexadecimal notation ; the hex look like
0012102
120187D

Now, much of the other records have C in place of the last D. I would like to find out the logical expression which will indicate to DFSORT to pick up only records in which the last character is (in hex view)
[any-digit]
D

Thank you for your help and time,

Re: Find records with any digit followed by D

PostPosted: Wed Feb 20, 2019 8:51 pm
by NicC
The brute force way would be to use 0D through 9D in your INCLUDE statements - only 10 conditions

Re: Find records with any digit followed by D

PostPosted: Wed Feb 20, 2019 8:58 pm
by RalphEagle
Indeed ; do you know of any less cumbersome way to deal with it ? For example, the find option allows P'#' to search for any numeric character... Isn't there anything similar in DFSORT ?

Re: Find records with any digit followed by D

PostPosted: Wed Feb 20, 2019 9:15 pm
by enrico-sorichetti
did You ever hear about the format of negative packed numbers ???

Re: Find records with any digit followed by D

PostPosted: Wed Feb 20, 2019 10:19 pm
by RalphEagle
It seems to me that packed numbers are represented with a final letter to indicate their sign: C for positive, D for negative, and I do not remember the others.

Re: Find records with any digit followed by D

PostPosted: Wed Feb 20, 2019 11:46 pm
by enrico-sorichetti
and I do not remember the others.

but the principle of operations does :mrgreen:


┌───────┬────────────────────────────┐
│       │ Recognized As              │
│ Code  ├─────────┬──────────────────┤
Binary │ Digit   │ Sign             │
├───────┼─────────┼──────────────────┤
│    0  │       0Invalid          │
│    1  │       1Invalid          │
│   10  │       2Invalid          │
│   11  │       3Invalid          │
│  100  │       4Invalid          │
│  101  │       5Invalid          │
│  110  │       6Invalid          │
│  111  │       7Invalid          │
1000  │       8Invalid          │
1001  │       9Invalid          │
1010  │ InvalidPlus             │
1011  │ Invalid │ Minus            │
1100  │ InvalidPlus - preferred │
1101  │ Invalid │ Minus -preferred │
1110  │ InvalidPlus             │
1111  │ InvalidPlus (zone)      │
└───────┴─────────┴──────────────────┘

 

Re: Find records with any digit followed by D

PostPosted: Thu Feb 21, 2019 3:16 pm
by NicC
So

And why should DFSort, which precedes ISPF by a number of years, have the same facilities?

Re: Find records with any digit followed by D

PostPosted: Fri Feb 22, 2019 8:08 pm
by RalphEagle
NicC wrote:So

And why should DFSort, which precedes ISPF by a number of years, have the same facilities?


I finally did this the other way around: I omitted every record greater than 0 (not sure if it's more/less/same efficient). However this still required to unpack the numbers, which I did from PD to FS format.

I also wasn't truly aware that DFSORT was there way before ISPF :o

Re: Find records with any digit followed by D

PostPosted: Fri Feb 22, 2019 9:48 pm
by enrico-sorichetti
However this still required to unpack the numbers,

not for the comparison .