Menu

#697 GCSORT - OUTREC FIELDS bug

contrib
closed
None
5 - default
2021-01-10
2021-01-04
Maksym
No

Hi,
I found an issue when I try to use OUTREC FIELDS.
Example:

  • input file: INPUT_FILE.txt
  • sort condition: SORT FIELDS=COPY OUTREC FIELDS=(X'27',4,10,X'27',68C' ') END
  • current output file: OUTPUT_FILE.txt
  • expected output file: EXPECTED_FILE.txt

The error is that bytes from input file should be overwritten by the OUTREC FIELDS command.

Thank you.

3 Attachments

Discussion

  • Sauro Menna

    Sauro Menna - 2021-01-06

    Hello,
    I solved the problem.
    I am working on a new version of GCSort, to solve some malfunctions in the MinGW environment.
    Changed the GCSort options test environment in Linux Fedora, MinGW, Windows.
    I also added the OUTREC OVERLAY option.
    By next Saturday I will be releasing the source package.
    Thanks.
    Sauro

     
  • Sauro Menna

    Sauro Menna - 2021-01-09

    Hi,
    problem fixed in Commit [r889] GCSort.
    Bye.
    Sauro

     

    Related

    Commit: [r889]

  • Maksym

    Maksym - 2021-01-10

    Hi,
    I have tested the fix for SORT FIELDS and it is working fine.
    I have tested OUTREC OVERLAY and it doesn't work as expected for example:
    gcsort USE BSEBIL06.txt ORG SQ RECORD F,114 GIVE SEMESTR ORG SQ RECORD F,116 " SORT FIELDS=COPY INREC OVERLAY=(115:X'10',116:X'10') END"
    I get the attempt to reference unallocated memory (signal sigsegv) error while I expected new line and carriage return.

    If I try gcsort USE BSEBIL06.txt ORG SQ RECORD F,114 GIVE SEMESTR ORG SQ RECORD F,116 " SORT FIELDS=COPY OUTREC OVERLAY=(115:X'10',116:X'10') END" the output file has NUL value.

    If I try gcsort USE BSEBIL06.txt ORG SQ RECORD F,114 GIVE SEMESTR ORG SQ RECORD F,116 " SORT FIELDS=COPY OUTREC OVERLAY=(115:C'A',116:C'Z') END" the output file has the same NUL value.

    Thank you.

     
    • Sauro Menna

      Sauro Menna - 2021-01-10

      Hi,
      fixed problem OUTREC FIELDS bug and OUTREC OVERLAY.
      I updated version in GCSort.
      Thank you.
      Sauro

       

      Last edit: Simon Sobisch 2021-01-10
  • Maksym

    Maksym - 2021-01-10

    Hi,
    I tested the updated version and INREC/ OUREC OVERLAY works fine .

    Thank you very much.
    Maksym.

     
    • Sauro Menna

      Sauro Menna - 2021-01-10

      Thank you for feedback.

      One tips, if you want convert file organization, you can use gcsort with

      input file SQ and ouput file LS (Line sequential).

      Example:

      USE inp002sq.sq ORG SQ RECORD F,100
      GIVE inp002sq.txt ORG LS RECORD F,100
      " SORT FIELDS=COPY END"

      Bye.
      Sauro

      Il 10/01/2021 20:13 Maksym <maksymn@users.sourceforge.net> ha scritto:
      
      
      
      Hi,
      I tested the updated version and INREC/ OUREC OVERLAY works fine .
      
      Thank you very much.
      Maksym.
      
      
      ---------------------------------------------
      
      [bugs:#697] https://sourceforge.net/p/gnucobol/bugs/697/ GCSORT - OUTREC FIELDS bug
      
      Status: open
      Group: unclassified
      Created: Mon Jan 04, 2021 11:42 AM UTC by Maksym
      Last Updated: Sun Jan 10, 2021 01:57 PM UTC
      Owner: Sauro Menna
      Attachments:
      
          * EXPECTED_FILE.txt https://sourceforge.net/p/gnucobol/bugs/697/attachment/EXPECTED_FILE.txt (80 Bytes; text/plain)
          * INPUT_FILE.txt https://sourceforge.net/p/gnucobol/bugs/697/attachment/INPUT_FILE.txt (80 Bytes; text/plain)
          * OUTPUT_FILE.txt https://sourceforge.net/p/gnucobol/bugs/697/attachment/OUTPUT_FILE.txt (80 Bytes; text/plain)
      
      Hi,
      I found an issue when I try to use OUTREC FIELDS.
      Example:
      input file: INPUT_FILE.txt
      sort condition: SORT FIELDS=COPY OUTREC FIELDS=(X'27',4,10,X'27',68C' ') END
      current output file: OUTPUT_FILE.txt
      expected output file: EXPECTED_FILE.txt
      
      The error is that bytes from input file should be overwritten by the OUTREC FIELDS command.
      
      Thank you.
      
      
      ---------------------------------------------
      
      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/gnucobol/bugs/697/
      
      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
      
       
  • Simon Sobisch

    Simon Sobisch - 2021-01-10
    • status: open --> closed
    • Group: unclassified --> contrib
     
  • Maksym

    Maksym - 2021-01-10

    Thank you for the tip.
    I have used it meanwhile INREC/OUTREC OVERLAY wasn't supported but it is limited only for this need.

    Bye.
    Maksym

     

Log in to post a comment.

MongoDB Logo MongoDB