Iterate through list of until record is null?

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iterate through list of until record is null?

  • Creator
    Topic
  • #55741
    Sterling Jones
    Participant

    Hi Folks,

    I get a file every day. It will not have a static number of rows. On any given day it could have between 5 and 2000 rows in it… maybe more. Each row has 10 columns, pipe-delimited. I went with a HRL of VRLs for the confguration, meaning it will be a HRL that could repeat any number of times, with each record consisting of 10 fields (the VRL).

    To process the file, which I’m turning into an X12 856, I have to iterate through each HRL row and build the segments. Again, each HRL row is a VRL with 10 fields. I hope my question isn’t too confusing, but I can’t figure out how to set the basis to iterate through the HRL list until nothing is found? I obviously can’t set the list iterate basis as 0 1 2 3 4 5 6 7 … 2000, so is there an easy, clean way to have an iterate keep going until it hits a null for the HRL?

Viewing 1 reply thread
  • Author
    Replies
    • #86363
      Jim Kosloskey
      Participant

      If all is configured properly, you would use a segment ITERATE not a List ITERATE.

      The Xlate will know when you have run out of repetitions.

      If you would like some personal assistance, email me. My email is on my signature.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #86364
      Sterling Jones
      Participant

      Big thank you, Jim. I changed the iterate to segment from list (%s1 as variable now), updated all references to the old %l1 variable, and made the HRL the basis. Changed the HRL itself to repeat up to 2000 times, and may go more after an analysis of past files. Simple fix. Thanks!

Viewing 1 reply thread
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,293
Replies
34,435
Topic Tags
286
Empty Topic Tags
10