ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Adding Fields to S36 Display File

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding Fields to S36 Display File

    Hi,
    First, thank you for your help in advance.
    Second, I know that some are going to grind their teeth and pound their head on the desk or wall but it is what it is....

    I need to add several fields to a S36 dspf and the original RPG36 program.

    I added the fields to the format in the DDS at the end to not upset the buffer and added the fields to the input and output specs for the format but I'm getting a decimal data error on the last line of the output specs for the format I added the fields to. It's a character field of 1 and I'm getting a message stating "Changed field is not a valid decimal number"

    What causes this and how do I correct this?

    Mike.
    Everyday's a school day, what grade are you in?

  • #2
    Your passing non numeric data to a numeric field on your screen. You need to verify which field it's blowing up by putting it in debug and stepping through the I/O until you hit the error. Either your Input or Output specs don't align with the dds or your not properly initializing fields prior to displaying them. You said you added several fields but then start talking about a 1 Character field. Did you code a 1 character field in your Input/output specs that is for a field that is coded numeric in the DDS?

    Comment


    • #3
      The reported line number for the error might not be the actual line causing the error. I can't recall the details, but I think I have seen cases with O specs where the last line of O specs gets flagged due to some other error in the program.

      I would try adding the new fields one at a time to the display file and the RPG program.

      Comment


      • #4
        I'd double-check the data types of the numeric fields in the I and O specs. I'm pretty sure they should all be zoned decimal, not packed.

        I doubt this is your problem, but I'd try to rule it out.

        Comment


        • #5
          Try to use DSPFFD myDspFile and compare the fields types and positions in the input and output buffer with your I and O specs.

          Comment


          • #6
            What I left out of my original post was that fields I was adding, were replacing existing fields, which I made ND and moved to an empty area of the screen. This threw a wrench into the works and after stepping back and doing one field at a time, discovered my error.

            Thank you everyone for your quick responses.
            I thought it would have been more complicated but for once it was an easy fix.

            Mike.
            Everyday's a school day, what grade are you in?

            Comment

            Working...
            X