IBM Security Z Security

 View Only
  • 1.  How to insert blank character if field is empty

    Posted Fri June 24, 2022 04:37 PM

    I'm hoping you can help me with something. I have an observation that looks something like this:

     

    MQ,MQCHANNEL,1000,20220522,,,PQ06,MJ.PCXV02.PSN57.S1,ClusSdr,,TCP,,,,TLS_RSA_WITH_AES_256_CBC_SHA256,,"CDF CLUSTER 2 - Tempe"

     I have a define that I'm using to access that field that looks like this:

     def Field16(char) as  word(record,16,",")

     When I try to select on that field using the following select statement, I get an error. Here is the select statement I'm using:

     Select Field9r0rn261<>('CLUSRCVR','RECEIVER','REQUEST','SRVCONN') F13=' '

     Is there a way to write the define so I can insert a blank character if the field is empty, or return a value if there is one in a way that can be used in the select/exclude statements?

     

    If this isn't clear in any way, I'm happy to try and expand it.



    ------------------------------
    Linnea Sullivan
    ------------------------------


  • 2.  RE: How to insert blank character if field is empty

    Posted Mon June 27, 2022 11:48 AM
    Hi Linnea,

    The value of field16 is "missing" with the shown input record.
    There is currently no way to convert a missing value to a value that "exists",
    although it is possible to change the display of a missing value with the CHR$STR format.

    To select the shown record, the selection statement could be changed to

    select (field16<>('CLUSRCVR','RECEIVER','REQUEST','SRVCONN') or missing(field16)),
           missing(field13)

    where field13 and field16 would be defined with

    def field13(char) as word(record,13,",")
    def field16(char) as word(record,16,",")

    Regards,

    ------------------------------
    Luc Rutten
    Advisory Software Engineer, zSecure
    IBM
    Delft
    ------------------------------



  • 3.  RE: How to insert blank character if field is empty

    Posted Tue June 28, 2022 02:56 AM
    Edited by Jeroen Tiggelman Tue June 28, 2022 11:45 AM
    Hi Linnea,

    In addition to what Luc wrote, a key point here is that a missing value is neither true nor false.

    That means that for a non-repeated field

    SELECT field16<>('CLUSRCVR','RECEIVER','REQUEST','SRVCONN') or missing(field16)

    is equivalent to

    EXCLUDE field16=('CLUSRCVR','RECEIVER','REQUEST','SRVCONN')

    and to convert the larger example, you could add a separate

    EXCLUDE exists(field13)

    statement.

    (You do have to be careful with converting (explicit or implicit) ANDs and ORs.)

    Regards,

    --Jeroen

    P.S. For repeated fields, the selection would be done if there was at least one value that is not in the list, which you cannot convert in this way.

    ------------------------------
    Jeroen Tiggelman
    Software Development and Level 3 Support Manager IBM Security zSecure Suite
    IBM
    Delft
    ------------------------------