Find records with any digit followed by D



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Find records with any digit followed by D

Postby RalphEagle » Wed Feb 20, 2019 8:45 pm

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,
RalphEagle
 
Posts: 24
Joined: Mon Apr 23, 2018 2:51 pm
Has thanked: 17 times
Been thanked: 0 time

Re: Find records with any digit followed by D

Postby NicC » Wed Feb 20, 2019 8:51 pm

The brute force way would be to use 0D through 9D in your INCLUDE statements - only 10 conditions
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
RalphEagle (Wed Feb 20, 2019 10:19 pm)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Find records with any digit followed by D

Postby RalphEagle » Wed Feb 20, 2019 8:58 pm

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 ?
RalphEagle
 
Posts: 24
Joined: Mon Apr 23, 2018 2:51 pm
Has thanked: 17 times
Been thanked: 0 time

Re: Find records with any digit followed by D

Postby enrico-sorichetti » Wed Feb 20, 2019 9:15 pm

did You ever hear about the format of negative packed numbers ???
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Find records with any digit followed by D

Postby RalphEagle » Wed Feb 20, 2019 10:19 pm

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.
RalphEagle
 
Posts: 24
Joined: Mon Apr 23, 2018 2:51 pm
Has thanked: 17 times
Been thanked: 0 time

Re: Find records with any digit followed by D

Postby enrico-sorichetti » Wed Feb 20, 2019 11:46 pm

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)      │
└───────┴─────────┴──────────────────┘

 
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Find records with any digit followed by D

Postby NicC » Thu Feb 21, 2019 3:16 pm

So

And why should DFSort, which precedes ISPF by a number of years, have the same facilities?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
RalphEagle (Mon Feb 25, 2019 6:12 pm)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Find records with any digit followed by D

Postby RalphEagle » Fri Feb 22, 2019 8:08 pm

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
RalphEagle
 
Posts: 24
Joined: Mon Apr 23, 2018 2:51 pm
Has thanked: 17 times
Been thanked: 0 time

Re: Find records with any digit followed by D

Postby enrico-sorichetti » Fri Feb 22, 2019 9:48 pm

However this still required to unpack the numbers,

not for the comparison .
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post