ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Negative no in extract file

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

  • Negative no in extract file

    Hi
    I have a field described as 2 long, signed numeric in an extract file. In the ILE pgm, this field is set to '-1'. The extract file only shows the 1, how can I see the '-' aswell.

    Devarshi.

  • #2
    Re: Negative no in extract file

    Try %editc(thefield:'J')
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: Negative no in extract file

      What are you using to display the data? Is this a packed field?

      Can you provide the spec for the field/file?

      Comment


      • #4
        Re: Negative no in extract file

        Hi
        The extract file has the field as -
        DTCOLR 2S 0 TEXT('Colour').

        I have to set it to -1 if more than one colour exists.

        Devarshi.

        Comment


        • #5
          Re: Negative no in extract file

          What are you extracting this to.
          .txt file or .XLS?????


          Thanks
          Jamie
          All my answers were extracted from the "Big Dummy's Guide to the As400"
          and I take no responsibility for any of them.

          www.code400.com

          Comment


          • #6
            Re: Negative no in extract file

            Do you have an edit code like EDTCDE(Z) specified in the extract file? This will alter the display of data in Qry/400 and Sql.
            Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

            Comment


            • #7
              Re: Negative no in extract file

              Hi
              I do not have any codes specified.

              I am extracting this into a numeric field within a file which will eventually be FTPed as a CSV file. When I view the extract file I cannot see the '-' sign. I am using EZVIEW and DSPPFM to view data.

              Devarshi.

              Comment


              • #8
                Re: Negative no in extract file

                If the value in the field is in fact negative when extracting to a spread sheet, use character and the bif I posted above. This will place the negative sign in the XLS sheet.

                You can also check the value by saying

                if field less than *zeros
                then add "-" to char field extracted.

                There is an example on the site of writting XLS directy to the ifs
                listed on the site. (doesnt use cpytoimpf or cpytostmf)


                jamie
                All my answers were extracted from the "Big Dummy's Guide to the As400"
                and I take no responsibility for any of them.

                www.code400.com

                Comment

                Working...
                X