Answer Wiki

What exactly are you trying to do?
If you have a program with a DSPF you can display the HEX value.
If you are doing a DSPPFM you can do an F10 to display HEX. I find it easier to read if I do an F11 after that.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your response...

Discuss This Question: 8 &nbspReplies

There was an error processing your information. Please try again later.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

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.

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

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'

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.

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. >_<

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy