I've tried to convert a 4-byte binary date field to a Gregorian date using this method in my Inrec Build:
INREC BUILD=((1:1,4,BI,TO=PD, LENGTH=4),Y2V,TOGREG=Y4T(-))
I was expecting the first conversion in the statement (within the inner parenthesis) to convert the 4-byte binary value X'0001AE23' (representing a decimal value 110115) into X'0110115C', and then the combination of the "Y2V,TOGREG=Y4T(-)" would execute a second conversion to C'2011-01-15'. Unfortunately, the Y2V seems to want an explicit "p,m,Yxx,todate" format, and isn't accepting the first conversion. I'm curious if it can be done, as all of the examples in the SORTUGPG.pdf are of the "p,m,Yxx,todate" nature.
After a couple hours of banging this around, I've tried another method - converting the binary date value to a PD value in a preliminary Copy to a temporary file, then using this temp file in my JOINKEYS where the PD date can be converted to Gregorian prior to submission to the Join. This is a bit cumbersome, so if there's a simpler method to do this in a single step I'd love to hear it.
Thanks.