DHLSameday1
75 pts. | Dec 1 2009 4:28PM GMT
Hi CharlieBrowne,
How do I display HEX value w/ a program using DSPF?
Thanks,
Alex
CharlieBrowne
7855 pts. | Dec 1 2009 6:21PM GMT
This can be done, but the question is why.
A HEX value is a single character or Byte. This is made up of bits. Each of these bits are 0 or 1. You can use the TESTB or %BIT op codes to determine the values.
If you are looking to check for invalid data, most of the time what causes errors in a field that has a value less than a blank X’40′. A SCAN can find and/or correct those values..
Some of the low Hex characters are what the display file uses for attribute bytes.
I would need more information to guide you to where you need to go. Becuase I am not sure at this time.
TomLiotta
18875 pts. | Dec 2 2009 3:25AM GMT
How do I display HEX value w/ a program using DSPF?
Well, technically DSPF will display the content of physical or logical files or streamfiles. When the content is displayed, you can press <F10=Display hex> and the hexadecimal equivalents will be displayed.
If you have a program that has a value that you want to see in hex, you have two general alternatives — you can code program instructions to convert the bytes to hex representation and display the result, or you can use debug and request that the value be displayed in hex.
==> eval MYVAR:x
To convert bytes to hex representation, you could use the Convert Character to Hex (CVTCH) MI builtin function. In a pinch, you can also use the REXX c2x() function.
Tom
ToddN2000
470 pts. | Dec 3 2009 5:01PM GMT
We had a similar problem here.
People were cut/pasting data into or AS/400 screens.
We could not display the data at all. Tried using DFU still failed.
Could not view as hex either.
What we ended up doing was a little cumbersome.
Find the RRN in the file with the problem from the dump.
Second using client access we transferd the data to an Excell spreadsheet.
The fixed the bad data by using STRSQL with the UPDATE / REPLACE options.
Another option was writing a fix progrqam to replace the bad hex code ( it was an ellipse …)
pasting it from excell int a single char position on the 400 is BAD.
We have a fix program now.
D DESCSV S 50
D IChar C Const(X’15′)
D*
D OChar C Const(X’40′)
*
C *ENTRY PLIST
C PARM CUST# 6
*
C CUST# SETLL FILEC
C CUST# READE FILEC
C DOW NOT %EOF
C EVAL DESCSV = DESC
C EVAL DESC = %xlate(IChar: Ochar: DESC)
C IF DESCSV <> DESC
C UPDATE RF$CN
C EXCEPT EDITREPORT
C ENDIF
C CUST# READE FILEC
C ENDDO
C
C EVAL *INLR = ‘1′
Koohiisan
1160 pts. | Dec 4 2009 3:16PM GMT
We had narrowed down our invalid data problem to a particular field. So, we did an interactive SQL command of:
update [file] set =trim(
That did the trick for us. As I recall, DFU was useless in this case…only SQL worked for us.
Koohiisan
1160 pts. | Dec 4 2009 3:17PM GMT
Sorry, I guess I didn’t properly format my message… It should have said my SQL was:
update [file] set = trim()
Koohiisan
1160 pts. | Dec 4 2009 3:22PM GMT
Last try, I promise…if this doesn’t post correctly I may have to post it in hexadecimal notation…
update myfile set problem_field = trim( problem_field )
Or maybe we did…
update myfile set problem_field = left( problem_field , 16 )
…since we knew how long the data was supposed to be. The more I think about it, the less I’m sure what we did. I suppose that if you knew which record it was, you could modify the prior statement to include a ‘where’ clause to specify that record and just keep shortening it by one character at a time until you get rid of the bad character.
I hope that makes sense. >_<






