Need variable length records defined as i/p to Cloverleaf

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Need variable length records defined as i/p to Cloverleaf

  • Creator
    Topic
  • #51201
    Johnny Anderson
    Participant

    CL 5.5, Sun, Solaris 10.

    I have an i/p flat file (friendly record) with variable length records, exp: 800, 750, 600, 700, etc.  800 is the max but never know ahead of time what

    any of the record lengths will be.  The fields are fixed length.  The last non-blank field will be there.  (trailing blank fields were truncated).  

    Do I use the VRL Configurator?  I read the manual, I don

Viewing 2 reply threads
  • Author
    Replies
    • #69169
      Jim Kosloskey
      Participant

      Johnny,

      Can you give us a little more definition?

      I suspect all of the fields cannot be fixed length or otherwise it would not be a variable length record.

      So I am guessing that one or more fields can have a variable length.

      A record layout would be helpful.

      At this point, given the descriotin you have provided, I am going to expect this to be an HRL definition with some mixture of FRL and VRL. The VRL ‘segments’ might consist of only one field or there could be more than one field.

      There might be a definition something like this:

      FRL

      FRL

      VRL

      FRL

      VRL

      FRL

      FRL

      VRL

      I don’t think you need to specify any separators for the VRL configurations.

      This almost sound like the traditional mainframe variable length record files produced typically from a COBOL program.

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

    • #69170
      Johnny Anderson
      Participant

      CL 5.5, Sun, Solaris 10.

      Jim, thanks for the quick reply.  I have a correction to this question. The i/p to Cloverleaf will be a fixed length record, but the length will not be known until

      an FTP is done with it.  The problem is at the FTP process.  We have  AS400 that creates the file at 800, but when the FTP copies it to the Sun file for i/p to

      Cloverleaf, it looks at the last non-blank field, decides the record length of that record, then truncates all the 800 length records in the file to be whatever

      that new calculated record length will be (exp: 650).  We don’t want that of course.  We want it to stay 800 so I can use the FRL Configurator as usual.

      How do I overcome this problem?  I want the 650 (or whatever) padded out to 800 with spaces.  All fields are fixed length. 👿

    • #69171
      Johnny Anderson
      Participant

      This is our solution.  We will use the AWK scripting language:

      AWK ‘{ printf( “%-800sn”, $0 ) }’  input.ext > output.ext  ðŸ˜€

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

Forum Statistics

Registered Users
5,127
Forums
28
Topics
9,300
Replies
34,445
Topic Tags
288
Empty Topic Tags
10