ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Logical file inquiry

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

  • Logical file inquiry

    Hi,

    When I am creating a new logical file is there a way I can separate a field into two separate fields. For example if I have a 11 character field in my physical file named custix and I want to create two new fields in the logical based on the first 8 characters and the last 3 characters is that doable?

    Thanks,

    DAC

  • #2
    Re: Logical file inquiry

    yes but why? IIRC building this using DDS (and possibly DDL) the LF can only be used for input only (but my memory is failing me these days). it's trivial to split the data in your program with a simple DS
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Logical file inquiry

      Yes, use the SST keyword (substring).

      From the DDS manual
      The format of the keyword is:
      SST(field-name starting-position [length])


      You could also use an SQL view or just as part of the Select statement.

      Comment


      • #4
        Re: Logical file inquiry

        SQL is the way to go here

        PHP Code:
        A
        A          R BATCHR1                   PFILE
        (BATCH)
        A            ZBACTV
        A            ZBGDAT
        A            ZBJDYS
        A            ZBWKNM
        A            ZBWKEN
        A            ZBFIL1
        A            ZBYEAR             I      SST
        (ZBGDAT 5 2)
        A          K ZBYEAR
        A          K ZBJDYS 
        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


        • #5
          Re: Logical file inquiry

          No, it's not restricted to input only.
          Regards

          Kit
          http://www.ecofitonline.com
          DeskfIT - ChangefIT - XrefIT
          ___________________________________
          There are only 3 kinds of people -
          Those that can count and those that can't.

          Comment

          Working...
          X