0
votes

Can someone help me with the procedure below?

It gives me the error on line 95 and I don`t know why?

IF (sfa_dz_type = "1" OR sfa_dz_type = "2" /*magda*/ OR sfa_dz_type = "6" OR sfa_dz_type = "7" OR sfa_dz_type = "8" /*magda*/) THEN DO:
   FIND LAST ttqr WHERE ttqr_new = sfa_dz_new NO-ERROR.
   IF AVAILABLE ttqr THEN DO:
   FIND FIRST usrw_wkfl WHERE usrw_domain = global_domain and usrw_key1 = "stocdz" AND usrw_key3 = locfrom AND usrw_charfld[2] = ttqr_old AND usrw_intfld[1] = 1 NO-ERROR.
   IF AVAILABLE usrw_wkfl THEN DO:
        FIND FIRST usrw_wkfl WHERE usrw_domain = global_domain and usrw_key1 = "stocdz" AND usrw_key3 = locto AND usrw_charfld[2] = ttqr_old NO-LOCK NO-ERROR.
        IF AVAILABLE usrw_wkfl THEN DO:
        output to value(lcDir + trim(engcode) + "log.txt") append.
        put today " "
        string(time,"hh:mm:ss")
        "Seria " usrw_charfld[7] " exista deja in locatia " locto SKIP.
       OUTPUT CLOSE.
        ASSIGN
            sfa_dz_trans = YES
            sfa_dz_dbok  = NO.
        END. /*avl usrw_wkfl*/
        ELSE DO:
        FIND FIRST usrw_wkfl WHERE usrw_domain = global_domain and usrw_key1 = "stocdz" AND usrw_key3 = locfrom AND usrw_charfld[2] = ttqr_old AND usrw_intfld[1] = 1 NO-ERROR.
        IF AVAILABLE usrw_wkfl THEN DO:
        ASSIGN
            part      = usrw_key4
            brand     = usrw_charfld[5]
            tip       = usrw_charfld[1].
            DELETE usrw_wkfl.
        END.
        create usrw_wkfl.           usrw_wkfl.usrw_domain = global_domain.
        assign
            usrw_key1 = "stocdz"
            usrw_key2 = locto + ttqr_old + string(TODAY)
            usrw_key3 = locto
            usrw_key4 = part
            usrw_charfld[5] = brand
            usrw_charfld[7] = sfa_dz_new
            usrw_charfld[1] = tip
            usrw_charfld[2] = ttqr_old
            usrw_intfld[1] = 1
            usrw_datefld[1] = TODAY
            usrw_charfld[3] = "mfg"
            usrw_charfld[4] = "dzreadtot.p"
            usrw_charfld[12] = locfrom
            usrw_charfld[14] = TRIM(sfa_dz_eng_code)
            usrw_charfld[15] = "transfer"
            usrw_charfld[13] = "mfg" + "|" + string(today) + "|"
            + string(time, "hh:mm:ss") + "|"
            + "dzreadtot.p".
            usrw_charfld[6] = string(time, "hh:mm:ss").
            output to value(lcDir + trim(engcode) + "log.txt") append.
            put today " "
            string(time,"hh:mm:ss") " "
            "Seria " usrw_charfld[7] " a fost transferata din locatia " locfrom " in locatia " locto SKIP.
            OUTPUT CLOSE.
            ASSIGN
                sfa_dz_trans = YES
                sfa_dz_dbok  = YES.
         /*trasabilitate*/
        create usrw_wkfl.               usrw_wkfl.usrw_domain = global_domain.
        assign
            usrw_key1 = "transfer_dz"
            usrw_key2 = part + string(recid(usrw_wkfl))
            usrw_key3 = locfrom
            usrw_key4 = locto
            usrw_key5 = part
            usrw_key6 = ttqr_old
            usrw_datefld[1] = today
            usrw_intfld[1] = 1
            usrw_charfld[1] = "mfg"
            usrw_charfld[2] = "dzreadtot.p"
            usrw_charfld[3] = string(today) + "_"
                            + string(time, "hh:mm:ss")
                            usrw_charfld[15] = "mutare echip"
            usrw_charfld[6] = string(time, "hh:mm:ss").
        END. /*else do*/
      END. /*avl usrw_wkfl*/
  ELSE DO:
      /*
      FIND FIRST usrw_wkfl WHERE usrw_domain = global_domain and usrw_key1 = "stocdz" AND usrw_key3 = locfrom AND usrw_charfld[2] = sfa_qr_old AND usrw_intfld[1] = 1 NO-ERROR.
      if not available usrw_wkfl then do:
        */
        output to value(lcDir + trim(engcode) + "log.txt") append.
        put today " "
        string(time,"hh:mm:ss") " "
        "Seria " ttqr_new " nu exista in locatia " locfrom
        " deci nu avem ce transfera " SKIP.
        OUTPUT CLOSE.
        ASSIGN
            sfa_dz_trans = YES
            sfa_dz_dbok  = NO.
  END.
 END. /*sfa_qr_code*/
   IF NOT AVAILABLE 
   THEN DO:
       output to value(lcDir + trim(engcode) + "log.txt") append.
            put today " "
            string(time,"hh:mm:ss") " "
            "Seria " sfa_dz_new " nu a fost niciodata inrolata, nu se poate efectua transferul din " locfrom " in locatia " locto SKIP.
        OUTPUT CLOSE.
        ASSIGN
            sfa_dz_trans = YES
            sfa_dz_dbok  = NO.
   END. 
1
If you compile with the option DEBUG-LIST <file> the file will tell what is line 95. Also what error do you get? - Jensd
It would certainly help if you showed the actual error message. - Tom Bascom

1 Answers

0
votes

I'm not sure if this helps; however, based on counting the lines up, I noticed near line 95 of what was pasted is

IF NOT AVAILABLE
THEN DO:

When I run the following

IF NOT AVAILABLE THEN DO:
DISPLAY YES.
END.

I get the following compiler messages:

** Unable to understand after -- "not". (247)
Missing table name after function. (399)
**  Could not understand line 1. (198)

I can't say if this is the error you are dealing with, since you didn't post the error message (they usually start with '**' and end with a number in parentheses (9999), like the above compiler messages). However, you'll still need to add the table name after IF NOT AVAILABLE.

I'm also not certain you pasted the entire program. Compiling with the option DEBUG-LIST as Jensd suggested would include any lines you didn't paste from your program, including the contents of any include files.