Menu

3.1 RC1 Question

GnuCOBOL
2020-07-26
2020-07-26
  • Ralph Linkletter

    What does this mean ?
    '-fassign=ibm' is ambiguous; possibilities: '-fassign-clause'
    The existing scripts worked with 3.0, 3.1 Dev
    Is IBM syntax for the Select assign clause no longer supported ?

    What does this mean ?
    -fassign-clause=<value> how to interpret 'ASSIGN word': as 'ASSIGN EXTERNAL word' or 'ASSIGN DYNAMIC word'
    What value ?</value>

    I thought the intent of improving -fassign was to support resolution of a dataset name via a batch file SET SYSUT1=C:\IBZANIM\GNUDATA\DATASET1 AND support the ASSIGN to with a static definition (MOVE 'C:\IBZANIM\GNUDATA\DATASET1.DAT to SYSUT1-DSN.
    Both forms would be accepted by the compiler and RTS in a single run unit.
    Is this not the case ?
    IBM format has been eliminated ?

     

    Last edit: Ralph Linkletter 2020-07-26
    • Simon Sobisch

      Simon Sobisch - 2020-07-26

      Without further looking I'd guess the name always was the longer one and you've just used an abbreviation. Use the longer and everything is fine with both versions.
      I'll have to recheck this as it looks strange, so thanks for the report.

       
  • Edward Hart

    Edward Hart - 2020-07-26

    As part of improving the ASSIGN clause syntax checks, new configuration options were added to control what extensions are allowed. The new config options all begin with assign-, which is why the abbreviated compiler flag -fassign is now ambiguous.

    IBM/EXTERNAL format is still suppoted - -fassign-clause=ibm will work as expected.

    I have clarified the help text in [r3735].

     
  • Ralph Linkletter

    _("how to interpret 'ASSIGN word': as 'ASSIGN EXTERNAL word' or 'ASSIGN DYNAMIC word', may be one of: dynamic, external, ibm (= external), mf (= dynamic)"))

    I thought the intent of improving -fassign was to support resolution of a dataset name via a batch file SET SYSUT1=C:\IBZANIM\GNUDATA\DATASET1 AND support the ASSIGN to with a static definition (MOVE 'C:\IBZANIM\GNUDATA\DATASET1.DAT to SYSUT1-DSN')
    Both forms would be accepted by the compiler and RTS in a single run unit.

    I presume "dynamic" implies both forms from above ?
    fassign-clause=mf,dynamic Correc t ?

    I would suggest that the diagnostic look more like this:
    -fassign=ibm' is ambiguous use the new form, for instance: -fassign-clause=ibm (add - clause)

     

    Last edit: Ralph Linkletter 2020-07-26
    • Edward Hart

      Edward Hart - 2020-07-26

      I presume "dynamic" implies both forms from above ? fassign-clause=mf,dynamic Correc t ?

      -fassign-clause=mf and -fassign-clause=dynamic are synonyms. An assign clause like ASSIGN sysut1 is interpreted as ASSIGN DYNAMIC sysut1. This means sysut1 is taken to be the name of a variable and you can do MOVE "/my/file/path" TO sysut1.

      Similarly, -fassign-clause=external is a syonym for -fassign-clause=ibm and ASSIGN sysut1 is interpreted as ASSIGN EXTERNAL sysut1.

      The new synonyms provide Micro Focus nomenclature.

      I thought the intent of improving -fassign was to support resolution of a dataset name via a batch file SET SYSUT1=C:\IBZANIM\GNUDATA\DATASET1 AND support the ASSIGN to with a static definition (MOVE 'C:\IBZANIM\GNUDATA\DATASET1.DAT to SYSUT1-DSN')
      Both forms would be accepted by the compiler and RTS in a single run unit.

      Yes. For example, consider the clause ASSIGN SYSUT1.

      • With -fassign-clause=mf and -fno-implicit-assign-dynamic-var, SYSUT1 is taken to be a variable name if such a variable exists, otherwise SYSUT1 is taken to be the name of an environment variable (an external-file-name).

      For completeness, here's what happens with other options:

      • With just -fassign-clause=mf (-fimplicit-assign-dynamic-var is on by default), SYSUT1 is taken to be a variable name and is defined for you if it isn't in the data division.
      • With -fassign-clause=ibm, SYSUT1 is always interpreted as the name of an environment variable.
       

      Last edit: Edward Hart 2020-07-26
  • Ralph Linkletter

    I think I understand now.
    Thank you Simon and Edward.

     
  • Ralph Linkletter

    OPEN ERROR DD SYSUT1 NOT FOUND RC=: 35

    -fassign-clause=mf does clean compile.
    However the environment setting of SYSUT1 does not seem to be resolved at execution.
    The script command for cobc was:
    %ANIMDRIVE%\IBZANIM\WINGNU\BIN\cobc %1 %2 %3 -O0 -fcorrect-numeric -fgoto-entry=ok -LC:\WINGNU\INCLUDE %4 -L%ANIMDRIVE%\IBZANIM\WINGNU\INCLUDE -x -**fassign-clause=mf **-fno-gen-c-decl-static-call -fbinary-size=2-4-8 --tsymbols -fsign=ebcdic -fcomplex-odo -fimplicit-init -fsticky-linkage -fperform-osvs -fmove-ibm -fhostsign -fnotrunc -fno-recursive-check -fdefaultbyte=00 -Xref -LC:\PROGRA~1\IBM\SQLLIB\LIB\Win32 -ldb2api

    The files referenced in the SET command are present in the directory as
    indicated by the SET environment variable.

    SET SYSUT1=%ANIMDRIVE%\IBZANIM\COBOL\EXAMPLE.COB
    SET SYSUT2=%ANIMDRIVE%\IBZANIM\COBOL\COPIED.COB
    STARTANIM
    WINANIM1 FILEPROB
    OPEN ERROR DD SYSUT1 NOT FOUND RC=: 35
    
    c:\IBZANIM\COBOL>DIR EXAMPLE.COB COPIED.COB
     Directory of c:\IBZANIM\COBOL
    04/17/2019  03:45 PM             6,633 EXAMPLE.COB
     Directory of c:\IBZANIM\COBOL
    06/22/2020  04:56 PM             6,632 COPIED.COB
    

    Results are as expected with 3.1 Dev and -fassign=ibm

    OPEN INPUT CBLFILE-SUCCESSFUL
    OPEN OUTPUT COB-FILE-SUCCESSFUL
    CBLFILE-STATUS:10
    RECORDS READ    =:0000000157
    RECORDS CREATED =:0000000157
    

    The banner line from the compile of FILEPROB.COB

    GnuCOBOL 3.1-rc1.0 C:\IBZANIM\COBOL\FIL Sun Jul 26 12:50:07 2020 Page 0001

    The code from FILEPROB.COB

            FILE-CONTROL.
               SELECT CBLFILE
                   ASSIGN TO SYSUT1
                   ORGANIZATION IS LINE SEQUENTIAL
                   FILE STATUS CBLFILE-STATUS.
    
               OPEN OUTPUT COB-FILE.
               IF COB-FILE-STATUS NOT = '00'
                   DISPLAY 'OPEN OUTPUT COB-FILE RC=:' COB-FILE-STATUS
                   MOVE '1' TO EOD-SOURCE
               ELSE
                   DISPLAY 'OPEN OUTPUT COB-FILE-SUCCESSFUL'
               END-IF.
    

    With 3.1 RC1.0 Neither -fassign-clause=mf NOR -fassign-clause=ibm appear to be functional.
    Both appear defective.

    This form of assign is operational with 3.1 RC1.0

               SELECT CBLFILE
                   ASSIGN TO SYSUT1-DSN
                   ORGANIZATION IS LINE SEQUENTIAL
                   FILE STATUS CBLFILE-STATUS
           77  SYSUT1-DSN PIC X(44) VALUE 'C:\IBZANIM\COBOL\EXAMPLE.COB'.
           77  SYSUT2-DSN PIC X(44) VALUE 'C:\IBZANIM\COBOL\COPIED.COB'.
    
     

    Related

    Bugs: #669


    Last edit: Simon Sobisch 2020-07-29

Log in to post a comment.