Page 1 of 1
Find records with any digit followed by D
Posted:
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
Posted:
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
Posted:
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
Posted:
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
Posted:
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
Posted:
Wed Feb 20, 2019 11:46 pm
by enrico-sorichetti
and I do not remember the others.
but the principle of operations does
┌───────┬────────────────────────────┐
│ │ Recognized As │
│ Code ├─────────┬──────────────────┤
│Binary │ Digit │ Sign │
├───────┼─────────┼──────────────────┤
│ 0 │ 0 │ Invalid │
│ 1 │ 1 │ Invalid │
│ 10 │ 2 │ Invalid │
│ 11 │ 3 │ Invalid │
│ 100 │ 4 │ Invalid │
│ 101 │ 5 │ Invalid │
│ 110 │ 6 │ Invalid │
│ 111 │ 7 │ Invalid │
│ 1000 │ 8 │ Invalid │
│ 1001 │ 9 │ Invalid │
│ 1010 │ Invalid │ Plus │
│ 1011 │ Invalid │ Minus │
│ 1100 │ Invalid │ Plus - preferred │
│ 1101 │ Invalid │ Minus -preferred │
│ 1110 │ Invalid │ Plus │
│ 1111 │ Invalid │ Plus (zone) │
└───────┴─────────┴──────────────────┘
Re: Find records with any digit followed by D
Posted:
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
Posted:
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
Re: Find records with any digit followed by D
Posted:
Fri Feb 22, 2019 9:48 pm
by enrico-sorichetti
However this still required to unpack the numbers,
not for the comparison .