Service Virtualization

  • 1.  Copybook Creation for Mainframe Virutalization

    Posted Mar 14, 2018 10:12 AM

    Hi Listeners,

    I'm trying to create a copybook where I have scenario where a group has to occur only when the dependency key value is of specific value.

     

    I have a group key as below.

    GROUP D-PREVIOUS-BOOK-GROUP depends on D-PREVIOUS-RESP-CODE. Keys = {331000}. and the D-PREVIOUS-RESP-CODE occurs prior to the group. My understanding of this notation is the group has to occur only when the D-PREVIOUS-RESP-CODE value is 331000. How do I create a copy book with this notation.

     

    Any help is much appreciated.

     

    Regards,

    Shivakumar.



  • 2.  Re: Copybook Creation for Mainframe Virutalization

    Broadcom Employee
    Posted Mar 14, 2018 10:38 AM

    Hi Shivakumar,

     

    I might be misunderstanding your question, but note that a copybook definition always defines a record of fixed length.

     

    If D-PREVIOUS-RESP-CODE is equal to 331000, it tells the program consuming the record that D-PREVIOUS-BOOK-GROUP contains valid data that should be used.

     

    If D-PREVIOUS-RESP-CODE is equal to any other value, there will still be space allocated in the record equal to the size of D-PREVIOUS-BOOK-GROUP.  The content might be all zeroes or some other filler, but it's still there.  The program consuming the record will simply ignore the content in this situation.

     

    BTW, this is similar with arrays.  If an array can have up to 10 items, space for all 10 will be allocated even if the indicated length is less.

     

    --Mike



  • 3.  Re: Copybook Creation for Mainframe Virutalization

    Posted Mar 14, 2018 11:09 AM

    Thanks Mike for the insight. In my case, I believe the consuming application is the virtual service because, the data I use to create the virtual service is fixed length req/res files. While creating, I use the copybook to slide and dice the message into an XML as per the copybook and store it in the service image.  This being the case, how do I represent the group with a key in the copybook ?

     

    Generally when I have GROUP D-PREVIOUS-BOOK-GROUP depends on D-PREVIOUS-RESP-CODE without a key = {} , I will represent this as

    05 D-STATIONERY-GROUP OCCURS 0 TO 1 DEPENDING ON D-PREVIOUS-RESP-CODE in the copybook which means the number of times the group occurrence is dependent on  D-PREVIOUS-RESP-CODE which is a length field.

     

    But in this case, I believe instead of merely taking the dependent field value and repeating the group those many times, I believe it has to compare the dependent field value (331000) and load the group ?

    or

    is it like,  irrespective of the dependent field value, the group has to load and if it is 331000, the group will have meaningful data else it will be empty spaces or zero's. Is that what you meant Mike?

     

     

    Regards,
    Shivakumar.

     

     



  • 4.  Re: Copybook Creation for Mainframe Virutalization

    Broadcom Employee
    Posted Mar 14, 2018 11:43 AM

    "is it like,  irrespective of the dependent field value, the group has to load and if it is 331000, the group will have meaningful data else it will be empty spaces or zero's."

     

    Correct.

     

    The copybook-to-xml process is performed by an open source library called cb2xml.  I think that library is generally smart enough to drop "ignorable" data such as arrays containing empty items.  That doesn't appear to be true in your case.

     

    Also, I may be incorrect about fixed length records.  If the group simply says "OCCURS 25 TIMES" it is a fixed length group.  If it has a "DEPENDS ON" length clause, it might be variable length.  I did a little research, and I'm getting conflicting information.

     

    --Mike



  • 5.  Re: Copybook Creation for Mainframe Virutalization

    Posted Mar 14, 2018 12:34 PM

    Thanks Mike. The group is a dynamic one and it will load based on the outcome of the comparison of the previous dependency field I believe. It should load the group only when the dependency field value is 33100 and ignore the group if it is something else.

     

    Unfortunately I don't have different req/res for this to compare against. Please let me know if you come across anything useful.

     

    Regards,

    Shivakumar.