RDSEQ NOT READING LINE CORRECTLY

SOLVED

Hi, 

We are planning on upgrading our system from V11 to V12 P29. One thing I noticed is that sage is not able to detect a new line when reading the trace file. When I read the trace file, sage thinks that everything is in 1 line when it is not. Is anybody else experiencing this issue? Does anybody have any ideas on what I can possibly try to resolve it?

Subprog EXECIML(IMPTEMP, FNAME, MESSAGE)

Value Char IMPTEMP
Value Char FNAME

Variable Char MESSAGE () ()

# Start the trace
Call OUVRE_TRACE ("EXECIML "-IMPTEMP) From LECFIC

Call IMPORTSIL(IMPTEMP, FNAME) From GIMPOBJ

# end/write the trace
Call FERME_TRACE From LECFIC

# open the trace file to get the details
Openi filpath("TRA",GTRACE,"tra",0) Using [ZZZ]

Local Integer I : I = 0
Local Integer LISTMAX : LISTMAX = 100

Local Char XLINE(100)
# read the file
Repeat

Rdseq XLINE Using [ZZZ]

If left$(XLINE,11)="Creation of"
MESSAGE = 'SUCCESS'
Openi Using [ZZZ]
End
Elsif left$(XLINE,59)=" You must finish this control in order to access this stock"
MESSAGE = left$(XLINE,59)
Openi Using [ZZZ]
End
Elsif left$(XLINE,2)="<0"
MESSAGE = MESSAGE+chr$(13)+chr$(10)+XLINE
Endif

If I >= LISTMAX : Break : Endif

Until fstat <> 0

# close the file
Openi Using [ZZZ]

End

Thanks

Chris 

Parents
  • 0

    Hi Chris, I don't understand your issue, can you please give a precise example?

  • 0 in reply to Bruno Gonzalez

    Hey Bruno, My issue is that the trace file is not being read correctly. It is concatenating all of the strings together. This was not an issue in v11 but is an issue with this new version for me. For example, my trace file would read like this: 

    #<AdxVL>@(#)%I% 06/09/2022 10:05:31 (ADMIN) EXECIML ZSDH
    ----------------------------------------------------------------------
    File Importing Sage\SAGEX3\folders\83197.txt
    ----------------------------------------------------------------------
    -------------------- Record No. 1 (Line Number 1)
    Creation of Delivery D-12167664

    1 records created

    Normal end of log file 06/09/2022 10:05:35

    When I try to read it useing rdseq, sage is reading it as 1 string so it would come back like this rather than it should be able to detect the new line...

    #<AdxVL>@(#)%I% 06/09/2022 10:05:31 (ADMIN) EXECIML ZSDH----------------------------------------------------------------------File ImportingSage\SAGEX3\folders\83197.txt------------------------------------------------------------------------------------------ Record No. 1 (Line Number 1)Creation of Delivery D-121676641 records createdNormal end of log file 06/09/2022 10:05:35

  • 0 in reply to ChrisCC

    I think something is wrong with your configuration as I tried right now on V12P29 and it works fine:

    I would advise to check your adxifs and adxirs variables to see how field and record separators are set.
    I don't believe this to be a bug, otherwise can you imagine all the rdseq in the product would do the same everywhere !

  • 0 in reply to Bruno Gonzalez

    How would you advise on what I can see is my adxifs or adxirs? I feel like something may have been setup incorrectly when we migrated over to V12. Is there like some system setting that may be resetting my adxirs value? Currently, I am setting my adxirs value to be chr$(13)+chr$(10)

  • 0 in reply to ChrisCC

    You're not supposed to set them, they are set automatically, notably depending if you're using Windows or Linux.
    Generally X3 is using LF (chr$(10)) as end of line character, but it can be CR+LF sometimes. Have you tried to read the content of a trace file directly without calling the importsil? It might be that the importsil is changing the adxirs value.
    FYI, if you need to modify adxirs or adxifs, use IOMODE instruction to only modify it for the file you are working with and not the whole product.

  • +1 in reply to Bruno Gonzalez
    verified answer

    Chris, we just started encountering this same issue, where it reads the entire trace file as one text glob, and doesn't recognize the line feeds.  It is happening on some versions of V12 and not others, so we are thinking of patch level affecting it.  We ended up inserting this line of code before the first openi statement, where you open the trace file.  This has resolved the issue for us, but we are still trying to determine why it only does this one some X3 instances and not others. 

    adxirs = chr$(10)

  • 0 in reply to Denise Hartman

    That is super weird ! Would you have the X3 and runtime version you are both using ?

Reply Children