问题
I have found that the command DSPF
(Display Physical file) does not correctly display records that contain a null. If I define a physical file in DDS with the ALWNULL
keyword on a field, then fill the file with data, DSPF
will correctly display the data for records without nulls, but all records that contain at least one null will display only blanks in both the null and the non-null fields.
This can be misleading. For example in the screenshot below, the seemingly blank records have data in most of their fields with null only in the date. It displays as blanks in character mode and as zeros in hex mode, not indicating what the real values stored in the physical file are.
Is there a different system command or freely available utility that shows what the data really is? I have found DSPF
to be quite useful in debugging and would like to be able to see what the characters and hex values (especially for packed decimals) really are. I could use SQL to see the data, but sometimes it is better to get a raw dump, especially if you are using RPG statements like SETLL
or CHAIN
and don't want to be misled by SQL ordering.
回答1:
DSPPFM shows the data for fields that aren't null, and it shows the default value for any fields that are null, usually blanks or zeros, but you can set a different default value when you create the file.
回答2:
SQL...
SQL doesn't have an ordering unless you give it one. So if you want to see data in the order that an RPG RLA program would be using it, specify 'ORDER BY KEY1, KEY2'
There are other commercial options, such as ProData's DBU utility. But SQL is your best bet.
来源:https://stackoverflow.com/questions/47781704/what-is-a-good-substitute-for-dspf-with-physical-files-that-contain-nulls