Skip to main content
Kevin King
Participating Frequently
Sep 1, 2021 4:10 PM UTC

Unidata - using Phrases

Phrases like @UQ and @LPTR are great but is there any version of Unidata where one can build a phrase and use it as if it were a field?  For example, if I had a phrase like this:

001 PH
002 WITH SUCCESS = "0" NAME AMOUNT

And I called it BAD, could I say: LIST filename BAD ​and have it expand the phrase where the phrase name is?

------------------------------
Kevin King
President
Precision Solutions, Inc.
Longmont CO United States
------------------------------

    3 replies

    Mike Bojaczko
    Participating Frequently
    Sep 4, 2021 10:52 PM UTC
    Phrases like @UQ and @LPTR are great but is there any version of Unidata where one can build a phrase and use it as if it were a field?  For example, if I had a phrase like this:

    001 PH
    002 WITH SUCCESS = "0" NAME AMOUNT

    And I called it BAD, could I say: LIST filename BAD ​and have it expand the phrase where the phrase name is?

    ------------------------------
    Kevin King
    President
    Precision Solutions, Inc.
    Longmont CO United States
    ------------------------------
    Hi Kevin,

    Sorry, if I don't understand your question fully. I know you are well versed in MV and I just want to make sure I understand what you are asking.

    In Universe, I can create a custom Phrase record named "BAD" in the VOC to be used with different UV files. My code is below. Hopefully, its formatted ok to read. Are you looking for something more?


    >LIST DICT MYFILE
    DICT MYFILE    22:14:19  09-04-21  Page 1
    
                   Type &
    Field......... Field. Field........ Conversion.. Column......... Output Depth &
    Name.......... Number Definition... Code........ Heading........ Format Assoc..
    
    @ID            D    0                            MYFILE          10L    S
    NAME           D    1                            NAME            20L    S
    AMOUNT         D    2               MD2Z,        AMOUNT          10R    S
    SUCCESS        D    3               MD0          SUCCESS         1R     S
    @              PH     NAME AMOUNT
                          SUCCESS
    
    5 records listed.
    >LIST MYFILE
    LIST MYFILE 22:14:23  09-04-21  PAGE 1
    MYFILE....    NAME................    AMOUNT....    SUCCESS
    
    1             JOHN DOE                     10.00          0
    2             JANE DOE                     20.00          1
    
    2 records listed.
    >
    >CT VOC 'BAD'
    
         BAD
    0001 PH
    0002 WITH SUCCESS = "0" NAME AMOUNT
    >
    >LIST MYFILE BAD
    LIST MYFILE BAD 22:14:36  09-04-21  PAGE 1
    MYFILE....    NAME................    AMOUNT....
    
    1             JOHN DOE                     10.00
    
    1 records listed.
    >
    
    
    
    ​

    Thanks,
    Mike

    ------------------------------
    Mike Bojaczko
    PROGRAMMER ANALYST
    United States
    ------------------------------
    Mike Rajkowski
    Rocketeer
    Sep 7, 2021 9:55 AM UTC
    Phrases like @UQ and @LPTR are great but is there any version of Unidata where one can build a phrase and use it as if it were a field?  For example, if I had a phrase like this:

    001 PH
    002 WITH SUCCESS = "0" NAME AMOUNT

    And I called it BAD, could I say: LIST filename BAD ​and have it expand the phrase where the phrase name is?

    ------------------------------
    Kevin King
    President
    Precision Solutions, Inc.
    Longmont CO United States
    ------------------------------
    Kevin,

    Are you having an issue with a Phrase?

    The phrase will be expanded. 


    For example, I know some of UniData partners use a phrase to only display the source code from their BP files.
    :CT DICT PBP @SOURCE
    PBP:

    @SOURCE:
    PH
    WITH @ID UNLIKE "_..."

    LIST PBP WITH @ID UNLIKE "_..." 06:48:01 Sep 07 2021 1
    ID............................

    FINDWAREHOUSE_PYFUNC
    GET_MEMBERS_RECORD
    LARGENUM_TEST
    SENDALERT_PYFUNC
    USE_PYTHON_DICT
    5 records listed


    ------------------------------
    Mike Rajkowski
    support
    Rocket Internal - All Brands
    DENVER CO United States
    ------------------------------
    Kevin King
    Participating Frequently
    Sep 7, 2021 4:37 PM UTC
    Kevin,

    Are you having an issue with a Phrase?

    The phrase will be expanded. 


    For example, I know some of UniData partners use a phrase to only display the source code from their BP files.
    :CT DICT PBP @SOURCE
    PBP:

    @SOURCE:
    PH
    WITH @ID UNLIKE "_..."

    LIST PBP WITH @ID UNLIKE "_..." 06:48:01 Sep 07 2021 1
    ID............................

    FINDWAREHOUSE_PYFUNC
    GET_MEMBERS_RECORD
    LARGENUM_TEST
    SENDALERT_PYFUNC
    USE_PYTHON_DICT
    5 records listed


    ------------------------------
    Mike Rajkowski
    support
    Rocket Internal - All Brands
    DENVER CO United States
    ------------------------------
    Figured out the issue.  The expansion doesn't work in ECLTYPE P but it does in ECLTYPE U.  Thanks for the help!

    ------------------------------
    Kevin King
    President
    Precision Solutions, Inc.
    Longmont CO United States
    ------------------------------