Is there a way to display invalid Characters in AS400 screen?

85 pts.
Character encoding

Is there a way to display invalid characters in AS400 screen?  Encountering invalid characters causes program error messages and end up cancelling user's job.


Alex Bernardo

Software/Hardware used:

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 7  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • DHLSameday1
    Hi CharlieBrowne, How do I display HEX value w/ a program using DSPF? Thanks, Alex
    85 pointsBadges:
  • CharlieBrowne
    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.
    62,280 pointsBadges:
  • TomLiotta
    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
    125,585 pointsBadges:
  • ToddN2000
    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'
    62,800 pointsBadges:
  • Koohiisan
    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.
    5,045 pointsBadges:
  • Koohiisan
    Sorry, I guess I didn't properly format my message... It should have said my SQL was:
    update [file] set  = trim()
    5,045 pointsBadges:
  • Koohiisan
    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. >_<
    5,045 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

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

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: