Menu

writing following files and indexes without records

Anonymous
2022-03-04
2022-03-13
  • Anonymous

    Anonymous - 2022-03-04

    I installed opencobolIDE and I wrote a program that writes in output to a follow-up file and another to an index file but in both files they are located in the right folder but always empty. What is missing to carry out the scripture? Some component or some link. Thank you

     
    • DaveR

      DaveR - 2022-03-04

      Worked here

      Output =
      
      001                                        002                    000
      002                                        003                    000
      

      DaveR

       

      Last edit: Simon Sobisch 2022-03-04
    • Anonymous

      Anonymous - 2022-03-05

      Change the directory with the embedded spaces. Sometimes embedded spaces in a directory work with GnuCOBOL - sometimes embedded spaces do not work.
      My observation running with Windows - don't know about LUX.

       
  • Arnold Trembley

    Arnold Trembley - 2022-03-04

    Here is a long example program that writes three line sequential files, using the three different SELECT..ASSIGN options, and reads them back. It's been tested inside OpenCobolIde where it requires a special environment variable.

    I also tested it outside of OpenCobolIde, by compiling and executing in a CMD.EXE window.

    I hope that helps!

     
  • Arnold Trembley

    Arnold Trembley - 2022-03-05

    Here is another sample program that creates an ISAM file with random access, and reads it back.

    I tested this using OpenCobolIde and GnuCOBOL 3.1.2 with VBISAM 2.0.1, so the indexed file name of "SYS101-FILE" actually created two files: "SYS101-FILE.dat" and "SYS101-FILE.idx".

     
    • Wayne Meriwether

      This program (demo-if) would do exactly what we need, but having problems with it; compiles fine but when I execute the program in a CMD window it always returns error message "error opening output file ... status code 30".

      How can I determine if the download package I am using contains VBISAM 2.01?

      Program comments say 'SYS101 Requires an Environment Variable named "SYS101" with a value of "C:\GCEXE\SYS101-FILE" '. What is GCEXE? In Windows 10 how do I create an environment variable?

      Does SYS101-FILE have to be created before running demo-if?

      Sorry for the beginner questions, and thanks a million for your help! If we were talking about a zOS DD or ALLOCATE statement I could write the book ...

      Cheers

      mod edit for some reply-to

       

      Last edit: Brian Tiffin 2022-03-12
      • Arnold Trembley

        Arnold Trembley - 2022-03-12

        Wayne,
        To determine if your Windows installation of GnuCOBOL has VBISAM or BDB, open a CMD.EXE window, navigate to the folder where the GnuCOBOL compiler is installed, and then run the "set_env.cmd" script to set GnuCOBOL environment variables and update the PATH.

        Then run the following command:
        cobcrun --info

        Read near the end of the messages and you should see something like this:

        sequential file handler  : built-in
        indexed file handler     : VBISAM
        mathematical library     : GMP, version 6.2.1
        XML library              : disabled
        JSON library             : cJSON, version 1.7.14
        extended screen I/O      : pdcurses, version 4.3.2 (CHTYPE=64, WIDE=0, UTF8=0)
        mouse support            : unknown
        

        In the example given for the demo-if program, C:\GCEXE is simply a folder on my home PC where I put compiled programs, and test data. Obviously, if you are going to set an environment variable for a file, it should point to a folder that exists.

        To set an environment variable, type a command like this into your CMD.EXE window, or put in a .bat/.cmd file:

        SET SYS101=C:\myfolder\myfilename

        in my example I used C:\GCEXE\SYS101-FILE. Remember that for VBISAM, it will create two files, one named SYS101-FILE.idx and one named SYS101-FILE.dat. This is similar to using a DD statement, where IBM VSAM creates an index and data component. Unlike IBM VSAM, there is no "cluster" component for VBISAM.

        If you're using BDB for ISAM support, then BDB puts index and data in a single file, and you have to provide a file extension in the file name. Otherwise, the file extension will be blank.

        Note that the demo-if.cob program is creating a NEW indexed file. Since the file is being opened initially for OUTPUT, it will be created. If the same name file already exists it should be deleted and overwritten. An output file can be created, but the folder where it will be created must already exist.

        I hope that helps!

         

        Last edit: Arnold Trembley 2022-03-12
        • Wayne Meriwether

          When I got the SET environment statement correct the program worked just fine. Thanks so much for your help!

          Wayne

          mod edit for some reply-to

           

          Last edit: Brian Tiffin 2022-03-13
      • Ralph Linkletter

        Hi Wayne.
        I publish an implementation of GnuCOBOL that addresses both zOS COBOL programmers and also addresses those programmers that favor an IDE using Windows .BAT files.
        Since you indicated you were very familiar with zOS JCL perhaps it may help your use of GnuCOBOL.
        WinCOBOL provides a simulation of zOS using all Windows components.
        The website is www.wincobol.com.
        There is no charge for anything associated with WinCOBOL.
        I'd be interested in whether you found WinCOBOL helpful.
        Ralph

         
        • Wayne Meriwether

          Hello Ralph, and thanks for reaching out. Yes, I am interested in using WinCobol. I went through the tutorials and they are excellent, but I had a couple of questions before I jump in with both feet.

          Is there ISAM or VSAM support for keyed access?

          Any reason why, once a couple of programs are compiled and tested, I couldn't produce batch reports on a regular basis? (I am a SCORE volunteer and we need some help with our webinar scheduling)

          Will I need a license for any zOS components? The programs will only be used in the Windows 10 environment.

          Please get back to me, and thanks again for your assistance.

          Regards,

          Wayne Meriwether
          W_meriwether@hotmail.comW_meriwether@hotmail.com

          mod edit for some reply-to

           

          Last edit: Brian Tiffin 2022-03-13
          • Ralph Linkletter

            The zOS components are a Windows simulation / emulation of zOS. There is no actual zOS mainframe link / component. WINZOS simulates zOS as if an actual zOS TSO / ISPF session were being conducted - but it is a simulation of zOS executing under Windows :-)
            The edit, compile, test process is as it would be with a "real" zOS ISPF session.

            There is keyed ISAM / VSAM support.
            From the zOS perspective VSAM support is assumed since IBM ISAM support ended in the early 90's.

            If you are using the zOS simulation you must create the VSAM file with IDCAMS. Meaning you cannot issue an OPEN OUTPUT for a VSAM file in your program.
            All WINZOS components are executed via JCL.

            In the EXAMPLES.Z.CNTL PDS you can find representative JCL for the IDCAMS utility. Member AIX5 does a cluster definition and the alternate index definition.

            In the EXAMPLES.Z.COBOL PDS are COBOL programs that will interact with the VSAM files created by the IDCAMS utility. Member READVSAM in particular.

            If you are using the WINDE interface then you can use OPEN OUTPUT (since there is no IDCAMS utility in Windows).
            There are .BAT files that are populated with VSAM examples (E5EXE.BAT in particular).
            There are example COBOL programs using the VSAM / ISAM access.
            E5.COB makes extensive use of ISAM / VSAM.

            zOS batch programs will store report files in the SDSF output panel (=S.O)
            You can print those reports by using function code "P" in the function code of the panel. They are not actually "printed" but rather extracted and stored in a file - other than the SDSF entry
            The reports are stored in \WINZOS\PDFSPOOL

            You should be able to write, test, and do reports on a regular basis.

            Hope this helps.
            Ralph

            There are no licensing requirements / charges.

             
            👍
            1

            Last edit: Ralph Linkletter 2022-03-12
            • Wayne Meriwether

              I think this will be a big productivity boost. I will proceed with downloading and a little testing.

              When I renamed the download zip file to .EXE I got the error message "ERROR: Central Directory Not Found" and "Cannot Open file 'WINCOBOL7V2.zip'. It does not appear to be a valid archive".

              I downloaded the '1 Click Install ...' button on the website - should I do something different?

              Wayne

              mod edit for some repy-to

               

              Last edit: Brian Tiffin 2022-03-13
              • Wayne Meriwether

                Sorry, finger check - the ZIP file is fine.

                Thanks

                mod edit for some reply-to

                 

                Last edit: Brian Tiffin 2022-03-13
              • Ralph Linkletter

                You must rename WINCOBOL7V2.ZIP to WINCOBOL7V2.EXE.
                The web hosting site will not permit the download of a .EXE
                Then open the .EXE and the install will begin.

                Sorrfy about that inconvenience.
                Ralph

                 

Anonymous
Anonymous

Add attachments
Cancel