Nice question Crox, and one that I don't think there is a solution for in straight SQL. The p'.' function in ISPF covers invalid characters which is (I think) basically anything that's not on your keyboard, or in other words some sort of hex value.
You are therefore looking to search through a CHAR column character by character and test to see if that character is not in ('A','B','C' etc.) or to see if that character is of the hex value '01', '02' etc.
I've considered the CHR and ASCII functions and got nowhere and looked at STRIP TRANSLATE etc. but haven't been able to come up with a solution. I'm not saying it can't be done, but it's beaten me I'm afraid.
You might try posting in the ANSI SQL forum as there's some members in there who I'm sure think in SQL!
Alternatively, you could run a query to get the data, export it to TSO and run an edit macro against it!
Most of the time you come up with something good so don't bother...
An edit macro in the batch or some smart usage of the sort utility can help perhaps.... That would also help and be good enough. I don't know if the p'.' search can be done in the batch with an ispf edit macro... never used it that way.
I'd go for a CTE with recursive SQL. Just build a query which searches for all printable characters. When your finished, just reverse the condition, or not
hi, I did find some solutions, but it didn't seem suitable for the job because it would cost too much cpu.
Some solutions people send on some other sites (mvshelp / mvsforums) are useable for a small amount of data. The convert construction you can find there, is ok.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.