Quantcast
Channel: Visual COBOL Knowledge Base
Viewing all 214 articles
Browse latest View live

When installing Enterprise Developer for Visual Studio 2010 a fatal error 0x80070643 is seen

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Kim.Hoskin on 12/31/2013 2:52:51 PM

Problem:

When installing Enterprise developer for Visual Studio 2010 a fatal error 0x80070643 is seen.

The Enterprise Developer Installation log shows entries such as:

C:\ProgramData\Package Cache\{BCDD05C1-4C6E-4E87-BC86-CCDE1EE9EAA3}v2.2.00244\Enterprise Developer\enterprisedevelopervisualstudio201022x64.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7"' [1C38:0D00][2013-10-15T14:48:02]e000: Error 0x80070643: Failed to uninstall MSI package.

Resolution:

This error can occur if there are older cached files in the Windows Temp folder.
The recommendation is to navigate to, and clear out the %temp% folder, then restart the installation process.

You can read more about this on article: http://social.msdn.microsoft.com/Forums/vstudio/en-US/65270574-aaa1-4e61-841d-6d0e1ccbd686/packages-failed-to-install-visual-studio-2012-premium?forum=vssetup 


ASLM: Semaphore failure when launching application on Runtime Environment - Server for COBOL 5.1

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Matthew Coronado on 1/8/2014 4:51:34 PM

Problem:

After installing and licensing Server for Cobol 5.1 correctly you receive a ASLM: Semaphore failure when trying to execute an application.

Resolution:

To run a Micro Focus application on a machine where the runtime has been installed, the environment variable %ASLMNET% must be set.

In the value of this variable, the name of your server can be used or the IP address of the server.

On the server, to run a Cobol application, the environment variable %ASLMNET% is not required.

If you need to have the same application (with the environment variable %ASLMNET%) on all computers, then the IP address must be used in the value of the environment variable %ASLMNET%.

Cannot install Visual Cobol 2.2 for Visual Studio 2012 on Windows 2008 R2

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Robert Milligan on 1/16/2014 10:21:46 AM

Problem:

The installation process fails to complete when attempting to install Visual Cobol 2.2 for Visual Studio 2012 on a Windows 2008 R2 machine.

Resolution:

The installation process fails because the VC 9.0 CRT is missing from the machine, and upgrading to Visual Cobol 2.2 Update 1 will rectify this issue.

Alternatively, as a workaround, installing the "Microsoft Visual C++ 2008 SP1 Redistributable Package" from http://www.microsoft.com/en-us/download/details.aspx?id=5582 will resolve the issue.

Variable to fixed length file conversion.

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by tonyt on 2/4/2014 12:56:30 PM

Problem

Why does rebuild pad with HEX0 as default using this command

rebuild ./datei.vari,./datei.fix_blank -o:lseq,rel -r:v1-100,f16p –i

Resolution

See - Using the manual.

The –o:lseq,rel the output is relative, so the default pad character is hex 0.

See - Using rebuild.

Here is an example of using the rebuild option which controls the pad character.

See - Using COBOL.

Here is an example of using COBOL, which can handle exceptions like long records

Using the manual.

The –o:lseq,rel the output is relative, so the default pad character is hex 0.

See this reference document for rebuild

Using rebuild.

Here is an example of using the rebuild option which controls the pad character.

This handles large records by creating new records with the extra data.

However, if the infile has records greater than your output file, this might not be what you require.

This type of record processing should be done using a COBOL program see using COBOL.

 

Using a file called infile.dat which has 11 records in it.

cat infile.dat

line 1
line 2
line 3
line 4
longer line of 32 bytes follows
        10        20        30        40
1234567890123456789012345678901234567890
2 empty record follows


last line of test

Here is the infile.dat in hex see the variable records delimited by x’0a’

od -t x1 infile.dat

0000000 6c 69 6e 65 20 31 0a 6c 69 6e 65 20 32 0a 6c 69
0000020 6e 65 20 33 0a 6c 69 6e 65 20 34 0a 6c 6f 6e 67
0000040 65 72 20 6c 69 6e 65 20 6f 66 20 33 32 20 62 79
0000060 74 65 73 20 66 6f 6c 6c 6f 77 73 0a 20 20 20 20
0000100 20 20 20 20 31 30 20 20 20 20 20 20 20 20 32 30
0000120 20 20 20 20 20 20 20 20 33 30 20 20 20 20 20 20
0000140 20 20 34 30 0a 31 32 33 34 35 36 37 38 39 30 31
0000160 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37
0000200 38 39 30 31 32 33 34 35 36 37 38 39 30 0a 32 20
0000220 65 6d 70 74 79 20 72 65 63 6f 72 64 20 66 6f 6c
0000240 6c 6f 77 73 0a 0a 0a 6c 61 73 74 20 6c 69 6e 65
0000260 20 6f 66 20 74 65 73 74 0a
0000271

The following command turns this file into a fixed length line sequential file,

- padded using spaces x’20’ decimal 32, by using the “pd32” option, and

- fixed length of 31 by using “f31” option

rebuild infile.dat,outfile.dat -i -o:lseq,rel -r:f31pd32

        File                             :   outfile.dat
        Organization                     :   Relative
        Recording Mode                   :   Fixed
        Compression                      :   N 
        Maximum Record Length            :                31
        Minimum Record Length            :                31
infile.dat,outfile.dat -i -o:lseq,rel -r:f31pd32
Rebuild successful - records read =        13

However checking the record count using wc shows 13 records when we only input 11 records

wc infile.dat
 11  27 185 infile.dat
 wc outfile.dat
 13  28 416 outfile.dat

This shows a problem, which would need a COBOL program to solve.

The two extra records are from two records which were greater than 31 bytes in length, and the rebuild has wrapped the extra data into two new records.

Here is the outfile.dat, you can see the two extra records.

cat outfile.dat

line 1                         
line 2                         
line 3                         
line 4                         
longer line of 32 bytes follows
        10        20        30 
       40                      
1234567890123456789012345678901
234567890                      
2 empty record follows         
                               
                               
last line of test              

Here is the outfile.dat in hex see the fixed records padded by spaces and records delimited by x’0a’

od -t x1 outfile.dat

0000000 6c 69 6e 65 20 31 20 20 20 20 20 20 20 20 20 20
0000020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a
0000040 6c 69 6e 65 20 32 20 20 20 20 20 20 20 20 20 20
0000060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a
0000100 6c 69 6e 65 20 33 20 20 20 20 20 20 20 20 20 20
0000120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a
0000140 6c 69 6e 65 20 34 20 20 20 20 20 20 20 20 20 20
0000160 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a
0000200 6c 6f 6e 67 65 72 20 6c 69 6e 65 20 6f 66 20 33
0000220 32 20 62 79 74 65 73 20 66 6f 6c 6c 6f 77 73 0a
0000240 20 20 20 20 20 20 20 20 31 30 20 20 20 20 20 20
0000260 20 20 32 30 20 20 20 20 20 20 20 20 33 30 20 0a
0000300 20 20 20 20 20 20 20 34 30 20 20 20 20 20 20 20
0000320 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a
0000340 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36
0000360 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 0a
0000400 32 33 34 35 36 37 38 39 30 20 20 20 20 20 20 20
0000420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a
0000440 32 20 65 6d 70 74 79 20 72 65 63 6f 72 64 20 66
0000460 6f 6c 6c 6f 77 73 20 20 20 20 20 20 20 20 20 0a
0000500 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0000520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a
0000540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0000560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a
0000600 6c 61 73 74 20 6c 69 6e 65 20 6f 66 20 74 65 73
0000620 74 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a
0000640

Using COBOL.

Here is an example of using COBOL, which can handle exceptions like long records

For all programs and scripts needed for this example, click the link and save as <vlseqflseq-001.tar>

In brief

Put the download on a unix machine with a COBOL complier installed.

Tar –xvf vlseqflseq-001.tar

This will unpack the files into a directory vlseqflseq

Cd vlseqflseq

There will be three main files

Change the setup.sh to point at the COBOL environment to be used, if not already set up.

. ./setup.sh

. ./buildit.sh

. ./runit.sh

execjobstep.cbl COBOL program shows some ways of processing line sequential, variable and fixed length records.

The runit.sh shows how to execute the particular sections in the execjobstep.cbl program.

There is a stripspace.cfg file, which allows many file attributes to be changed.

There is a execjobstep.dir directives file

In detail

Change the setup.sh to point at the COBOL environment to be used, if not already set up.

cat setup.sh

#
COBMODE=64
export COBMODE
#
COBDIR=/home/products/sx51ws6
export COBDIR
#
LD_LIBRARY_PATH=$COBDIR/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
#
PATH=$COBDIR/bin:$PATH
export PATH
#


Run the setup.sh script

. ./setup.sh

Now build the execjobstep.cbl program that tests the file conversion program logic using buildit.sh

cat buildit.sh

#! /bin/bash
#
# compile the cobol executable from execjobstop.cbl
#
#cat execjobstep.dir
cob -xV -C use="execjobstep.dir" execjobstep.cbl -o execjobstep
#
# end
#

Run the buildit.sh script

. ./buildit.sh

version @(#)cob.c	5.1.4.0
PRN=RXCTS/AAK:9p.k5.51.07
PTI=WrapPack 6
PTI=ES
PTI=Fixpack51.07_05
* Micro Focus Server Express         V5.1 revision 000           Compiler
* Copyright (C) Micro Focus IP Development Limited 1984-2012.
* Accepted - verbose
* Accepted - nolist
* Accepted - use(execjobstep.dir)
* Accepted - showdir
* Accepted - list()
* Accepted - settings
* Accepted - SOURCEFORMAT"VARIABLE"
* Accepted - ANIM
* Accepted - DATAMAP
* Accepted - XREF
* Accepted - TRACE
* Compiling execjobstep.cbl
* Total Messages:     0
* Data:       15344     Code:        2893
* Generating cross reference
* End of cross reference listing
* Micro Focus Server Express V5.1.00 Code Generator
* Copyright (C) Micro Focus IP Development Limited 1984-2012.
* Accepted - verbose
* Generating execjobstep
* Data:     15128  Code:      4437  Literals:       464  Dynamic:    741376

This compiles one program that has the logic to test the conversion logic execjobstep.cbl

cat exexjobstep.cbl

       identification division.
       program-id. execjobstep.
      *
      * Test variable input giving fixed padded output 
      *
       environment division.
       configuration section.
       input-output section.
       file-control.

           select jobstep 
               assign to "jobstep"
               organization is line sequential
               status file-status.

           select infile 
               assign to "infile"
               organization is line sequential
               status file-status.

           select outfile 
               assign to "outfile"
               organization is line sequential
               status file-status.

       data division.
       file section.

       fd  jobstep
           record varying from 1 to 4096 characters 
               depending on jobstep-line-length.
       01  jobstep-rec                           pic x(4096).
 
       fd  infile
           record varying from 1 to 4096 characters 
               depending on infile-line-length.
       01  infile-rec                            pic x(4096).

       fd  outfile
           record varying from 1 to 4096 characters 
               depending on outfile-line-length.
       01  outfile-rec                           pic x(4096).
       
       working-storage section.
       01  jobstep-line-length                   pic 9(4).
       01  infile-line-length                    pic 9(4).
       01  outfile-line-length                   pic 9(4).
       
       01  ans                                   pic x.
       
       01  file-status.
           03  status-key-1                      pic x.
           03  status-key-2                      pic x.

       01  abort-flag                            pic x value "N".
           88  not-in-abort                        value "N".
           88  in-abort                            value "Y".
           
       01  bin-table.
           03  bin-elements.
               05  bin-definition.
                   07  filler                    pic x(32) value
                   "000102030405060708090A0B0C0D0E0F". 
                   07 filler                     pic x(32) value
                   "101112131415161718191A1B1C1D1E1F". 
                   07 filler                     pic x(32) value
                   "202122232425262728292A2B2C2D2E2F". 
                   07 filler                     pic x(32) value
                   "303132333435363738393A3B3C3D3E3F". 
                   07 filler                     pic x(32) value
                   "404142434445464748494A4B4C4D4E4F". 
                   07 filler                     pic x(32) value
                   "505152535455565758595A5B5C5D5E5F". 
                   07 filler                     pic x(32) value
                   "606162636465666768696A6B6C6D6E6F". 
                   07 filler                     pic x(32) value
                   "707172737475767778797A7B7C7D7E7F". 
                   07 filler                     pic x(32) value
                   "808182838485868788898A8B8C8D8E8F". 
                   07 filler                     pic x(32) value
                   "909192939495969798999A9B9C9D9E9F". 
                   07 filler                     pic x(32) value
                   "A0A1A2A3A4A5A6A7A8A9AAABACADAEAF". 
                   07 filler                     pic x(32) value
                   "B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF". 
                   07 filler                     pic x(32) value
                   "C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF". 
                   07 filler                     pic x(32) value
                   "D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF". 
                   07 filler                     pic x(32) value
                   "E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF". 
                   07 filler                     pic x(32) value
                   "F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF". 
               05  bin-data  redefines bin-definition 
                                                 pic xx occurs 256.
       

       01  input-bin-area.
           03  bin                               pic x.
           88  goodchar values are
             x'20' thru x'7F'.
           03  bin-numeric redefines bin         pic 99 comp-x.
           
       01  test-display.
           03  test-line-sub                     pic 9(4).
           03  test-length-max                   pic 9(4) value 132.
           03  test-length                       pic 9(4).
           03  test-line occurs 3                pic x(132).
                      
       01  environment-data                      pic x(256).
       01  padchar                               pic x.
       01  fixedlength                           pic 9(4).
       01  truncate-flag                         pic x.
           88 truncate                         value "Y".
       01  infile-line-sub                       pic 9(4).
       
       procedure division.
       declaratives.

       decljobstep section.
           use after standard error procedure on jobstep.
       decljobstep-010.
           display "decljobstep declarative executing"
           perform check-file-status
           .
       decljobstep-090.
           exit.

       declinfile section.
           use after standard error procedure on infile.
       declinfile-010.
           display "declinfile declarative executing"
           perform check-file-status
           .
       declinfile-090.
           exit.

       decloutfile section.
           use after standard error procedure on outfile.
       decloutfile-010.
           display "decloutfile declarative executing"
           perform check-file-status
           .
       decloutfile-090.
           exit.
 
       check-file-status.
           display "check-file-status file-status <",
                                      file-status, ">"
           set in-abort to true
           .

       end declaratives.
        
       main section.
       main-010.
           display "main Started >>>>"
           perform init
           if not-in-abort
               perform work
           end-if
           perform fini
           display "main press any key to return"
           accept ans
           .
       main-090.
           goback.

       init section.
       init-010.
           display "init Started >>>>"
           set not-in-abort to true
           open input jobstep
           read jobstep
           display "init jobstep-line-length <",
                         jobstep-line-length, ">"
           display "init jobstep-rec <", 
                    jobstep-rec(1:jobstep-line-length), ">"
           .
       init-090.
           exit.
           
       work section.
       work-010.
           display "work Started >>>>"
           evaluate jobstep-rec(1:jobstep-line-length)
      *
      * perform the required jobstep
      *
           when "vlseqflseq"
               perform vlseqflseq
           when "vlseqflseqhexout"
               perform vlseqflseqhexout
           when other
               set in-abort to true
               display "work invalid jobstep <",
                        jobstep-rec(1:jobstep-line-length), ">"
           end-evaluate
           .
       work-090.
           exit.
      *
      * read variable length to fixed length with pad char
      *
       vlseqflseq section.
       vlseqflseq-010.
           display "vlseqflseq Started >>>>"
           open output outfile
                input  infile

           move 32 to outfile-line-length
           read infile

           perform until file-status <> "00"
               write outfile-rec from infile-rec
               read infile
               at end
                   continue
               end-read
           end-perform
           display ">"

           close outfile, 
                 infile
           .
       vlseqflseq-090.
           exit.
      *
      * read variable length to fixed length with pad char
      * out put the output-rec in hex
      * input padchar decimal 0 to 255 default 32
      *       fixedlength 0 to 4096     default 32
      *       truncate "Y" or "N"      default "Y"
      *
       vlseqflseqhexout section.
       vlseqflseqhexout-010.
           display "vlseqflseqhexout Started >>>>"
           open output outfile
                input  infile

           display "padchar" upon environment-name
           accept environment-data from environment-value
           on exception
               move " " to bin 
           not on exception
               move function numval(environment-data) to bin-numeric    
           end-accept
           move bin to padchar
           display "padchar <"
           move padchar to test-line(1)
           move 1 to test-length
           perform test-output
           display ">"
           
           display "fixedlength" upon environment-name
           accept environment-data from environment-value
           on exception
               move 32 to fixedlength
           not on exception
               move function numval(environment-data) to fixedlength    
           end-accept
           display "fixedlength <", fixedlength, ">"
           
           display "truncate" upon environment-name
           accept environment-data from environment-value
           on exception
               set truncate to true
           not on exception
               move environment-data(1:1) to truncate-flag    
           end-accept
           display "truncate <", truncate-flag, ">"

           read infile

           perform until file-status <> "00"
               move fixedlength to outfile-line-length
               if infile-line-length > fixedlength
                   if truncate
                       write outfile-rec from infile-rec
                       display "record truncated <", 
                                infile-rec(1:infile-line-length), ">"
                   else
                       move infile-line-length to outfile-line-length
                       write outfile-rec from infile-rec
                   end-if
               else
                   compute infile-line-sub = infile-line-length + 1 
                   perform varying infile-line-sub
                       from infile-line-sub by 1
                       until infile-line-sub > fixedlength
                       move padchar to infile-rec(infile-line-sub:1)
                   end-perform
                   write outfile-rec from infile-rec
               end-if
               move outfile-rec(1:outfile-line-length) to test-line(1)
               move outfile-line-length to test-length
               perform test-output
               read infile
               at end
                   continue
               end-read
           end-perform
           display ">"

           close outfile, 
                 infile
           .
       vlseqflseqhexout-090.
           exit.

       fini section.
       fini-010.
           display "fini Started >>>>"
           close jobstep
           .
       fini-090.
           exit.

       test-output section.
       test-output-010.
           if test-length > test-length-max
               move test-length-max to test-length
           end-if
           perform varying test-line-sub
               from 1 by 1
               until test-line-sub > test-length
               move test-line(1)(test-line-sub:1) to bin
               move bin-data(bin-numeric + 1)(1:1) to
                    test-line(2)(test-line-sub:1)
               move bin-data(bin-numeric + 1)(2:1) to
                    test-line(3)(test-line-sub:1)
               if not goodchar
                   move "." to test-line(1)(test-line-sub:1)
               end-if
           end-perform
           display test-line(1)(1:test-length)
           display test-line(2)(1:test-length)
           display test-line(3)(1:test-length)
           .
       test-output-090.
           exit.

       end program execjobstep.

The build uses a directives file to control the compilation execjobstep.dir

cat exexjobstep.dir

showdir
list()
settings
SOURCEFORMAT"VARIABLE"
ANIM
DATAMAP
XREF
TRACE

The runit.sh has all of the tests to be run against the test program execjobstep.

cat runit.sh

#! /bin/bash
#
# set up file environment variables
#
dd_jobstep=$PWD/jobstep.dat
export dd_jobstep
dd_infile=$PWD/infile.dat
export dd_infile
#
# lets just put some test data into infile
#
cat >$dd_infile << EOF
line 1
line 2
line 3
line 4
longer line of 32 bytes follows
        10        20        30        40
1234567890123456789012345678901234567890
2 empty record follows


last line of test
EOF
#
# need set stripspace = OFF in external file handler extfh configuration file
# to get the space padded records.
#
EXTFH=$PWD/stripspace.cfg
export EXTFH
#
dd_outfile=$PWD/outfile.dat
export dd_outfile
#
# read variable length to fixed length with pad char
#
echo "vlseqflseq" >$dd_jobstep
./execjobstep
#
# read variable length to fixed length with pad char
# out put the output-rec in hex
# input padchar decimal 0 to 255 default 32
#       fixedlength 0 to 4096    default 32
#       truncate "Y" or "N"      default "Y"
#
padchar=255
fixedlength=30
truncate=Y
export padchar
export fixedlength
export truncate
echo "vlseqflseqhexout" >$dd_jobstep
./execjobstep
#
truncate=N
export truncate
./execjobstep
#
unset truncate
unset padchar
./execjobstep
#
fixedlength=41
export fixedlength
padchar=128
export padchar
./execjobstep
#
fixedlength=1
export fixedlength
./execjobstep
#
unset fixedlength
padchar=0
export padchar
./execjobstep
#
fixedlength=0
export fixedlength
./execjobstep
#
truncate=N
export truncate
./execjobstep
#
unset padchar
unset fixedlength
unset truncate
./execjobstep
#
# end
#

The runit.sh uses a file EXTFH=$PWD/stripspace.cfg to control some file attributes for file handling of the outfile this is the name of the file inside execjobstep.cbl.

Cat stripspace.cfg

[XFH-DEFAULT]

[INTERNAL:outfile]
STRIPSPACE=OFF

Run the runit.sh script, press enter each time when prompted.

. ./runit.sh

main Started >>>>
init Started >>>>
init jobstep-line-length <0010>
init jobstep-rec <vlseqflseq>
work Started >>>>
vlseqflseq Started >>>>
>
fini Started >>>>
main press any key to return

main Started >>>>
init Started >>>>
init jobstep-line-length <0016>
init jobstep-rec <vlseqflseqhexout>
work Started >>>>
vlseqflseqhexout Started >>>>
padchar <
.
F
F
>
fixedlength <0030>
truncate <Y>
line 1........................
666623FFFFFFFFFFFFFFFFFFFFFFFF
C9E501FFFFFFFFFFFFFFFFFFFFFFFF
line 2........................
666623FFFFFFFFFFFFFFFFFFFFFFFF
C9E502FFFFFFFFFFFFFFFFFFFFFFFF
line 3........................
666623FFFFFFFFFFFFFFFFFFFFFFFF
C9E503FFFFFFFFFFFFFFFFFFFFFFFF
line 4........................
666623FFFFFFFFFFFFFFFFFFFFFFFF
C9E504FFFFFFFFFFFFFFFFFFFFFFFF
record truncated <longer line of 32 bytes follows>
longer line of 32 bytes follow
666667266662662332677672666667
CFE7520C9E50F603202945306FCCF7
record truncated <        10        20        30        40>
        10        20        30
222222223322222222332222222233
000000001000000000200000000030
record truncated <1234567890123456789012345678901234567890>
123456789012345678901234567890
333333333333333333333333333333
123456789012345678901234567890
2 empty record follows........
3266777276667626666677FFFFFFFF
205D0490253F2406FCCF73FFFFFFFF
..............................
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
..............................
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
last line of test.............
66772666626627677FFFFFFFFFFFFF
C1340C9E50F604534FFFFFFFFFFFFF
>
fini Started >>>>
main press any key to return

main Started >>>>
init Started >>>>
init jobstep-line-length <0016>
init jobstep-rec <vlseqflseqhexout>
work Started >>>>
vlseqflseqhexout Started >>>>
padchar <
.
F
F
>
fixedlength <0030>
truncate <N>
line 1........................
666623FFFFFFFFFFFFFFFFFFFFFFFF
C9E501FFFFFFFFFFFFFFFFFFFFFFFF
line 2........................
666623FFFFFFFFFFFFFFFFFFFFFFFF
C9E502FFFFFFFFFFFFFFFFFFFFFFFF
line 3........................
666623FFFFFFFFFFFFFFFFFFFFFFFF
C9E503FFFFFFFFFFFFFFFFFFFFFFFF
line 4........................
666623FFFFFFFFFFFFFFFFFFFFFFFF
C9E504FFFFFFFFFFFFFFFFFFFFFFFF
longer line of 32 bytes follows
6666672666626623326776726666677
CFE7520C9E50F603202945306FCCF73
        10        20        30        40
2222222233222222223322222222332222222233
0000000010000000002000000000300000000040
1234567890123456789012345678901234567890
3333333333333333333333333333333333333333
1234567890123456789012345678901234567890
2 empty record follows........
3266777276667626666677FFFFFFFF
205D0490253F2406FCCF73FFFFFFFF
..............................
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
..............................
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
last line of test.............
66772666626627677FFFFFFFFFFFFF
C1340C9E50F604534FFFFFFFFFFFFF
>
fini Started >>>>
main press any key to return

main Started >>>>
init Started >>>>
init jobstep-line-length <0016>
init jobstep-rec <vlseqflseqhexout>
work Started >>>>
vlseqflseqhexout Started >>>>
padchar <
 
2
0
>
fixedlength <0030>
truncate <Y>
line 1                        
666623222222222222222222222222
C9E501000000000000000000000000
line 2                        
666623222222222222222222222222
C9E502000000000000000000000000
line 3                        
666623222222222222222222222222
C9E503000000000000000000000000
line 4                        
666623222222222222222222222222
C9E504000000000000000000000000
record truncated <longer line of 32 bytes follows>
longer line of 32 bytes follow
666667266662662332677672666667
CFE7520C9E50F603202945306FCCF7
record truncated <        10        20        30        40>
        10        20        30
222222223322222222332222222233
000000001000000000200000000030
record truncated <1234567890123456789012345678901234567890>
123456789012345678901234567890
333333333333333333333333333333
123456789012345678901234567890
2 empty record follows        
326677727666762666667722222222
205D0490253F2406FCCF7300000000
                              
222222222222222222222222222222
000000000000000000000000000000
                              
222222222222222222222222222222
000000000000000000000000000000
last line of test             
667726666266276772222222222222
C1340C9E50F6045340000000000000
>
fini Started >>>>
main press any key to return

main Started >>>>
init Started >>>>
init jobstep-line-length <0016>
init jobstep-rec <vlseqflseqhexout>
work Started >>>>
vlseqflseqhexout Started >>>>
padchar <
.
8
0
>
fixedlength <0041>
truncate <Y>
line 1...................................
66662388888888888888888888888888888888888
C9E50100000000000000000000000000000000000
line 2...................................
66662388888888888888888888888888888888888
C9E50200000000000000000000000000000000000
line 3...................................
66662388888888888888888888888888888888888
C9E50300000000000000000000000000000000000
line 4...................................
66662388888888888888888888888888888888888
C9E50400000000000000000000000000000000000
longer line of 32 bytes follows..........
66666726666266233267767266666778888888888
CFE7520C9E50F603202945306FCCF730000000000
        10        20        30        40.
22222222332222222233222222223322222222338
00000000100000000020000000003000000000400
1234567890123456789012345678901234567890.
33333333333333333333333333333333333333338
12345678901234567890123456789012345678900
2 empty record follows...................
32667772766676266666778888888888888888888
205D0490253F2406FCCF730000000000000000000
.........................................
88888888888888888888888888888888888888888
00000000000000000000000000000000000000000
.........................................
88888888888888888888888888888888888888888
00000000000000000000000000000000000000000
last line of test........................
66772666626627677888888888888888888888888
C1340C9E50F604534000000000000000000000000
>
fini Started >>>>
main press any key to return

main Started >>>>
init Started >>>>
init jobstep-line-length <0016>
init jobstep-rec <vlseqflseqhexout>
work Started >>>>
vlseqflseqhexout Started >>>>
padchar <
.
8
0
>
fixedlength <0001>
truncate <Y>
record truncated <line 1>
l
6
C
record truncated <line 2>
l
6
C
record truncated <line 3>
l
6
C
record truncated <line 4>
l
6
C
record truncated <longer line of 32 bytes follows>
l
6
C
record truncated <        10        20        30        40>
 
2
0
record truncated <1234567890123456789012345678901234567890>
1
3
1
record truncated <2 empty record follows>
2
3
2
.
8
0
.
8
0
record truncated <last line of test>
l
6
C
>
fini Started >>>>
main press any key to return

main Started >>>>
init Started >>>>
init jobstep-line-length <0016>
init jobstep-rec <vlseqflseqhexout>
work Started >>>>
vlseqflseqhexout Started >>>>
padchar <
.
0
0
>
fixedlength <0032>
truncate <Y>
line 1..........................
66662300000000000000000000000000
C9E50100000000000000000000000000
line 2..........................
66662300000000000000000000000000
C9E50200000000000000000000000000
line 3..........................
66662300000000000000000000000000
C9E50300000000000000000000000000
line 4..........................
66662300000000000000000000000000
C9E50400000000000000000000000000
longer line of 32 bytes follows.
66666726666266233267767266666770
CFE7520C9E50F603202945306FCCF730
record truncated <        10        20        30        40>
        10        20        30  
22222222332222222233222222223322
00000000100000000020000000003000
record truncated <1234567890123456789012345678901234567890>
12345678901234567890123456789012
33333333333333333333333333333333
12345678901234567890123456789012
2 empty record follows..........
32667772766676266666770000000000
205D0490253F2406FCCF730000000000
................................
00000000000000000000000000000000
00000000000000000000000000000000
................................
00000000000000000000000000000000
00000000000000000000000000000000
last line of test...............
66772666626627677000000000000000
C1340C9E50F604534000000000000000
>
fini Started >>>>
main press any key to return

main Started >>>>
init Started >>>>
init jobstep-line-length <0016>
init jobstep-rec <vlseqflseqhexout>
work Started >>>>
vlseqflseqhexout Started >>>>
padchar <
.
0
0
>
fixedlength <0000>
truncate <Y>
record truncated <line 1>



record truncated <line 2>



record truncated <line 3>



record truncated <line 4>



record truncated <longer line of 32 bytes follows>



record truncated <        10        20        30        40>



record truncated <1234567890123456789012345678901234567890>



record truncated <2 empty record follows>









record truncated <last line of test>



>
fini Started >>>>
main press any key to return

main Started >>>>
init Started >>>>
init jobstep-line-length <0016>
init jobstep-rec <vlseqflseqhexout>
work Started >>>>
vlseqflseqhexout Started >>>>
padchar <
.
0
0
>
fixedlength <0000>
truncate <N>
line 1
666623
C9E501
line 2
666623
C9E502
line 3
666623
C9E503
line 4
666623
C9E504
longer line of 32 bytes follows
6666672666626623326776726666677
CFE7520C9E50F603202945306FCCF73
        10        20        30        40
2222222233222222223322222222332222222233
0000000010000000002000000000300000000040
1234567890123456789012345678901234567890
3333333333333333333333333333333333333333
1234567890123456789012345678901234567890
2 empty record follows
3266777276667626666677
205D0490253F2406FCCF73






last line of test
66772666626627677
C1340C9E50F604534
>
fini Started >>>>
main press any key to return

main Started >>>>
init Started >>>>
init jobstep-line-length <0016>
init jobstep-rec <vlseqflseqhexout>
work Started >>>>
vlseqflseqhexout Started >>>>
padchar <
 
2
0
>
fixedlength <0032>
truncate <Y>
line 1                          
66662322222222222222222222222222
C9E50100000000000000000000000000
line 2                          
66662322222222222222222222222222
C9E50200000000000000000000000000
line 3                          
66662322222222222222222222222222
C9E50300000000000000000000000000
line 4                          
66662322222222222222222222222222
C9E50400000000000000000000000000
longer line of 32 bytes follows 
66666726666266233267767266666772
CFE7520C9E50F603202945306FCCF730
record truncated <        10        20        30        40>
        10        20        30  
22222222332222222233222222223322
00000000100000000020000000003000
record truncated <1234567890123456789012345678901234567890>
12345678901234567890123456789012
33333333333333333333333333333333
12345678901234567890123456789012
2 empty record follows          
32667772766676266666772222222222
205D0490253F2406FCCF730000000000
                                
22222222222222222222222222222222
00000000000000000000000000000000
                                
22222222222222222222222222222222
00000000000000000000000000000000
last line of test               
66772666626627677222222222222222
C1340C9E50F604534000000000000000
>
fini Started >>>>
main press any key to return

Note

This is a test program which demonstrates how to use Unix environment variable handling and some basic COBOL file handling. To understand the output, it is important to study the code in execjobstep.cbl.


 

Tags: COBOL, extfh, Debugging, rebuild

How to remote debug using attach to process

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by tonyt on 3/7/2014 2:12:03 PM

Problem

How to attach to a remote unix process and debug, using Visual COBOL for eclipse based on a PC.

 

Requirements

VISUAL COBOL for eclipse installed on PC.

<See Installing Visual COBOL on Windows>

 

Visual COBOL development hub installed on the Unix machine.

<See Installing Micro Focus Visual COBOL Development Hub>

 

RDO daemon process must be running.

<See Configuring the Remote System Explorer Support>

 

Resolution

High level diagram & summary

Two remote projects are created in the same workspace using Visual COBOL for eclipse on a PC

quickdebug is the actual development project.

APquickdebug is the glue for attaching to the deployed running process to debug and test.

APquickdebug references the quickdebug project

APquickdebug has a debug configuration, which has quickdebug referenced for source code and the debug symbols.

tesbin is a soft symbolic link created on the unix machine in the APquickdebug unix project area. NB. this is not created using the IDE, see detailed section below.

 

On the unix side

/Quickdebug and /APquickdebug are created by the PC eclipse IDE.

/testbin needs to be created as this is where the quickdebug executable will be deployed to.

A symbolic link to testbin needs to be created inside /APquickdebug project area using the Unix command line not the eclipse IDE.

Detailed set up and run.

1 Create a remote COBOL project quickdebug.

2 Create a test environment.

3 Create deployment script.

4 Create a remote COBOL project APquickdebug.

5 Create a symbolic soft link.

6 Setup for debug.

7 Setup the debug configuration.

8 Start the debugger.

9 Use the debugger.

1 Create a remote COBOL project quickdebug

Insert the code from Program1.cbl below

The code for Program1.cbl
program-id. Program1 as "Program1".

       environment division.
       configuration section.

       data division.
       working-storage section.
       01  ans           pic x.

       procedure division.
       main section.
       main-010.
           display "started program 1"

           move space to ans

           perform until ans ="Q"
               display "press Q enter to exit..."
               accept ans
           end-perform
           .
       main-090.
           goback.

       end program Program1.


This program will just sit there accepting input until “Q” is pressed.

This emulates a standalone process which we can attach to and debug.

2 Create a test environment

Make a directory testbin in the user home directory on the Unix machine.

>mkdir testbin

This is to emulate deployment of the executable quickdebug to a test environment.

3 Create deployment script

Automatically deploy the executable quickdebug to the test environment, by using the post build event of the quickdebug project.

set –x
echo "deploying quickdebug to testbin"
pwd
cp -p New_Configuration.bin/quickdebug ../APquickdebug/testbin
ls -l ../APquickdebug/testbin/
ls -l New_Configuration.bin
echo "done it"

4 Create a remote COBOL project APquickdebug.

/APquickdebug holds all the required information to glue the source code and debugging symbols in /quickdebug with the executable in /testbin.

In order not to interfere with the test area, create a remote project on the same machine as /testbin, but in a different /APquickdebug location.

5 Create a symbolic soft link.

APquickdebug needs to know how \ where to find the quickdebug executable in the test environment testbin.

On the unix machine using the command prompt, not the eclipse IDE, create a symbolic link to the test environment testbin directory using a command like this.

soft link example
ln -s /home/support/support/tonyt/testbin /home/support/support/tonyt/testit/APquickdebug/testbin

5 Create setup and run test scripts

The scripts to setup the test environment and run the test application have been put into the APquickdebug remote project, they can be put anywhere on the UNIX machine.

Examples of setup.sh and runit.sh are given below

The setup.sh
#!/usr/bin/bash
#
#set -x
JAVA_HOME=/usr/java6
export JAVA_HOME
PATH=/usr/java6/bin:$PATH:
export PATH
java -version

. /home/products/vcdevhub22/bin/cobsetenv

export COBMODE=32
which cob
cob -V

LANG=en_US
export LANG

TERM=vt220
export TERM
#
# end
#

 

The runit.sh
#!/usr/bin/bash
# trace myprogram
#truss -e -rall -f -o junk.truss ./Program1
#
oldpwd=$PWD
cd testbin
./quickdebug
cd $oldpwd
# 
# end
#

6 Setup for debug.


Put a project reference in APquickdebug to quickdebug.

Clean compile both projects, and make sure the executable is copied to the test environment ~/testbin

On the unix machine in the APquickdebug project, run the setup.sh and the runit.sh to start the executable quickdebug in the test environment testbin directory.

 

/home1/support/support/tonyt/testit/APquickdebug >. ./setup.sh
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap3260sr6-20090925_01(SR6))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc-32 jvmap3260sr6-20090923_42924 (JIT enabled, AOT enabled)
J9VM - 20090923_042924
JIT  - r9_20090902_1330ifx1
GC   - 20090817_AA)
JCL  - 20090924_01
COBDIR set to /home/products/vcdevhub22
/home/products/vcdevhub22/bin/cob
version @(#)cob.c       2.2.0.93
PRN=KXCAI/AAD:Ao.U4.13.04
PTI=32/64 bit
PTI=Micro Focus Visual COBOL Development Hub 2.2
PTI=pkg_77569
PTI=ES
PTI=SOA Configured
I see no work
/home1/support/support/tonyt/testit/APquickdebug >. ./runit.sh
started program 1
press Q enter to exit...


The application will be asking for input.

7 Setup the debug configuration.

We need to attach to this process and debug it using the eclipse IDE, and the glue which is the APquickdebug project.

Create a debug configuration for the APquickdebug project.

In General settings - remove X Server (DISPLAY)

In Source settings - add quickdebug project


In Common settings - remove allocate console

In Debug symbols  - add quickdebug project

8 Start the debugger.

Apply these settings and press debug, and a select process menu will appear.

Enter quickdebug and press OK.

In the debug perspective you should see something like this

Now set a breakpoint on line 18

Double click in left margin.

Now press zoom to allow the program to continue

 

Go to the application and enter a value “x” and press enter; now the code should break at line 18 allowing for debugging of the test environment application.

9 Use the debugger.

The debugger is attached to the program in testbin and using the source and debug symbols in the quickdebug project via a glue project APquickdebug.

Note

Just clean compiling both projects seems to reset everything in case of any trouble.

Tags: visual cobol, COBOL, Debugging

Location of Configuration Files for Visual COBOL for Eclipse

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by ppimental on 3/17/2014 4:32:33 PM

Question:

Where are the runtime and debug configuration files stored or remote projects on Eclipse.

Answer:

The workspace stores the configuration files in  <workspace>/.metadata/.plugins/.org.eclipse.debug.core/.launches.

This file can be opened via any text editor.

Eclipse help when indexed using JRE7 produces lots of errors in the error log

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Robert Milligan on 3/20/2014 11:51:57 AM

Problem:

There are a large number of errors in the error log after indexing of Eclipse help has completed.

Not all of them are shown, as they are all basically the same error:

!ENTRY org.eclipse.help.base 4 0 2014-03-18 15:51:59.938 !MESSAGE An error occured while pre-processing help XHTML document "/com.microfocus.eclipse.help.ed.windows/html/HRERRHSERRLA.html" for search indexing !STACK 0 org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.  at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)  at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)  at org.eclipse.help.internal.dynamic.DocumentReader.read(DocumentReader.java:56)  at org.eclipse.help.internal.dynamic.XMLProcessor.process(XMLProcessor.java:49)  at org.eclipse.help.internal.xhtml.DynamicXHTMLProcessor.process(DynamicXHTMLProcessor.java:76)  at org.eclipse.help.internal.search.XHTMLSearchParticipant.preprocess(XHTMLSearchParticipant.java:106)  at org.eclipse.help.search.SearchParticipantXML.addDocument(SearchParticipantXML.java:296)  at org.eclipse.help.internal.search.HTMLSearchParticipant.addDocument(HTMLSearchParticipant.java:51)  at org.eclipse.help.internal.search.SearchIndex.addDocument(SearchIndex.java:231)  at org.eclipse.help.internal.search.IndexingOperation.addDocuments(IndexingOperation.java:252)  at org.eclipse.help.internal.search.IndexingOperation.addNewDocuments(IndexingOperation.java:159)  at org.eclipse.help.internal.search.IndexingOperation.execute(IndexingOperation.java:106)  at org.eclipse.help.internal.search.LocalSearchManager.updateIndex(LocalSearchManager.java:671)  at org.eclipse.help.internal.search.LocalSearchManager.ensureIndexUpdated(LocalSearchManager.java:645)  at org.eclipse.help.internal.search.LocalSearchManager.search(LocalSearchManager.java:590)  at org.eclipse.help.internal.search.SearchManager.searchLocal(SearchManager.java:103)  at org.eclipse.help.internal.search.SearchManager.search(SearchManager.java:94)  at org.eclipse.help.internal.search.SearchProgressMonitor$2.run(SearchProgressMonitor.java:162)  at java.lang.Thread.run(Unknown Source)

!ENTRY org.eclipse.help.base 4 0 2014-03-18 15:52:06.832 !MESSAGE An error occured while pre-processing help XHTML document "/com.microfocus.eclipse.help.ed.windows/html/GUID-E08E00FA-EFB0-480B-894A-8060166787BC.html" for search indexing !STACK 0 org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.  at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)  at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)  at org.eclipse.help.internal.dynamic.DocumentReader.read(DocumentReader.java:56)  at org.eclipse.help.internal.dynamic.XMLProcessor.process(XMLProcessor.java:49)  at org.eclipse.help.internal.xhtml.DynamicXHTMLProcessor.process(DynamicXHTMLProcessor.java:76)  at org.eclipse.help.internal.search.XHTMLSearchParticipant.preprocess(XHTMLSearchParticipant.java:106)  at org.eclipse.help.search.SearchParticipantXML.addDocument(SearchParticipantXML.java:296)  at org.eclipse.help.internal.search.HTMLSearchParticipant.addDocument(HTMLSearchParticipant.java:51)  at org.eclipse.help.internal.search.SearchIndex.addDocument(SearchIndex.java:231)  at org.eclipse.help.internal.search.IndexingOperation.addDocuments(IndexingOperation.java:252)  at org.eclipse.help.internal.search.IndexingOperation.addNewDocuments(IndexingOperation.java:159)  at org.eclipse.help.internal.search.IndexingOperation.execute(IndexingOperation.java:106)  at org.eclipse.help.internal.search.LocalSearchManager.updateIndex(LocalSearchManager.java:671)  at org.eclipse.help.internal.search.LocalSearchManager.ensureIndexUpdated(LocalSearchManager.java:645)  at org.eclipse.help.internal.search.LocalSearchManager.search(LocalSearchManager.java:590)  at org.eclipse.help.internal.search.SearchManager.searchLocal(SearchManager.java:103)  at org.eclipse.help.internal.search.SearchManager.search(SearchManager.java:94)  at org.eclipse.help.internal.search.SearchProgressMonitor$2.run(SearchProgressMonitor.java:162)  at java.lang.Thread.run(Unknown Source)

Resolution:

Please refer to https://community.oracle.com/thread/2594170 as this issue appears to be a bug in the JDK. (https://bugs.openjdk.java.net/browse/JDK-8028111).

The links discuss a workaround, but the ultimate solution is to upgrade to JRE7_U55 or later where the bug is fixed.

Visual COBOL Checker: error COBCH1504 : I-O error : 9/181

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Claudio.Contardi on 4/9/2014 8:43:57 AM

Problem:

A Visual COBOL solution can be built without issues on a Windows 7 64-bit box, using Visual Studio 2010.
After having moved the solution directory to a shared location on the local intranet, the compilation process abends with the following error:

------ Rebuild All started: Project: MyProject, Configuration: Debug x86 ------
* Compiling K:\MyDirectory\MyProject\MyProgram.cbl
K:\MyDirectory\MyProject\MyProgram.cbl (1234,5) : error COBCH1504 : I-O error : 9/181 obj\x86\Debug\MyProgram.int
 COBOL compile: 0 item(s) succeeded or up-to-date, 1 failed.
Build of project "MyProgram.cblproj" NON COMPLETED.

Resolution:

The issue is caused by the fact that the remote location, often a network drive, is considered as an unknown file system and allows 32-bit access by default.
This may cause the Visual COBOL checker to stop with an error, being launched from a 64-bit Operating System.

To force the checker to activate the 64-bit access to the remote drive, set the following tunable to TRUE:

remote_64bit_access TRUE

This tunable can be set in a configuration file, i.e.: myconf.cfg.

The configuration file can be made available to the checker setting the following environment variable:

set COBCONFIG_=C:\MyDirectory\myconf.cfg


2738 Error during installation of Visual COBOL for Eclipse

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Kim.Hoskin on 4/9/2014 9:00:25 AM

Problem:

During the installation of Visual COBOL for Eclipse, the error code 2738 is reported.

Resolution:

The installer is giving this error code because the VBscript component is not installed correctly.

For further details see http://www.error.info/windows/installation-2738.html

How to redirect Controls common client (MFCC) tracing to an output file.

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Kim.Hoskin on 4/10/2014 6:55:13 AM

Problem:

What is required to redirect Controls common client (MFCC) tracing to an output file?


Resolution:

To redirect Controls common client (MFCC) tracing to an output file, use the option:

    file=<pathname>

This allows the user to specify the full path of the file to receive the trace messages.

This parameter must be defined in the mf-client.dat file, which by default is located in the product installation directory e.g C:\Program Files (x86)\Micro Focus\Visual COBOL\bin\

Intrinsic function DISPLAY-OF and Environment variable $LANG

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Douetteau on 4/25/2014 11:51:28 AM

Problem :

The DISPLAY-OF function with a class national returns an incorrect string.

Solution:

The DISPLAY –OF function uses the value of the environment variable $LANG to define the character encoding of the returned string .

 

Example :

$LANG=en_US.utf8  

DISPLAY-OF   returns   a UTF8 string  

 

$LANG=en_US.iso885915  

DISPLAY-OF   returns   an   ISO   string  

 

Unable to modify runtime environment by imtkmake

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Douetteau on 4/25/2014 11:51:38 AM

Problem :

 

With cobimtk or Net Express or Enterprise Server , is it possible to modify the Enterprise Server Run-time Environment ?

 

Solution:

 

With the option esruntime of imtkmake it is possible to define the Enterprise Server Run-Time Environment. The value of this option is the path of a xml file .

The xml file is created by cobimtk with the extension rtc , and can be used with imtkmake .

The following is the   text of the xml file :

<?xml version="1.0" encoding="UTF-8" ?>

<mf:application_configuration

   xmlns:mf="http://xml.microfocus.com/schema/appconfig/v1.0/mfappcfg.xsd"

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

   xsi:schemaLocation="http://xml.microfocus.com/schema/appconfig/v1.0/mfappcfg.xsd http://xml.microfocus.com/schema/appconfig/v1.0/mfappcfg.xsd">

   <mf:envvars>

   </mf:envvars>

   <mf:switches>

       <mf:rts_switch name="I" value="on" index="2"/>

       <mf:rts_switch name="S" value="off" index="5"/>

       <mf:rts_switch name="A" value="off" index="1"/>

       <mf:rts_switch name="C" value="off" index="4"/>

       <mf:rts_switch name="N" value="on" index="0"/>

       <mf:rts_switch name="F" value="on" index="0"/>

       <mf:rts_switch name="O" value="on" index="0"/>

       <mf:rts_switch name="S" value="off" index="0"/>

   </mf:switches>

   <mf:tunables>

       <mf:ansi_input_mode value="false"/>

       <mf:default_cancel_mode value="1"/>

       <mf:use_lock_wait value="true"/>

       <mf:sort_memory value="0"/>

       <mf:dynamic_memory_limit value="2147483647"/>

       <mf:shared_memory_segment_size value="65536"/>

       <mf:program_search_order value="2"/>

       <mf:command_line_accept value="false"/>

       <mf:arguments_are_initial value="false"/>

       <mf:mainframe_floating_point value="false"/>

       <mf:use_lock_wait value="true"/>

       <mf:entry_point_mapper_search_order value="0"/>

       <mf:memory_strategy value="1"/>

       <mf:memory_free_check_size value="100"/>

       <mf:no_mfredir value="false"/>

       <mf:entry_point_mapper_alias_exists_error value="true"/>

   </mf:tunables>

   <mf:deployment>

       <mf:app_always_exits value="true"/>

       <mf:max_success_code_enabled value="false"/>

       <mf:max_success_code value="0"/>

       <mf:reuse_container_after_error value="true"/>

       <mf:reuse_container value="true"/>

   </mf:deployment>

</mf:application_configuration>

 

 

Database cursor being automatically closed after COMMIT

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Chris Glazier on 4/25/2014 7:59:27 PM

Problem

A program that used to run fine under Net Express has been recompiled using Visual COBOL.
The program uses OpenESQL to do a EXEC SQL OPEN on a declared cursor and then proceeds into a loop that fetches each row from the cursor, potentially updating that row and executing an EXEC SQL COMMIT.

In Net Express this worked fine but in Visual COBOL the commit statement appears to be closing the cursor because the next fetch after the commit results in a sqlcode = -10000 Function Sequence Error.

What can I do to fix this? 

Resolution:

In Net Express the default setting for the SQL(BEHAVIOR) directive was UNOPTIMIZED while in Visual COBOL the default is now MAINFRAME.

When BEHAVIOR=MAINFRAME is used the default cursor handling is to close a cursor at the end of a transaction, which is signaled by a COMMIT or ROLLBACK.

To change this you can set BEHAVIOR to either UNOPTIMIZED or ANSI and the cursors will no longer be closed.

An alternative to this is to use the WITH HOLD phrase when declaring the cursor and then it will always keep the cursor open even when BEHAVIOR is set to MAINFRAME.

Example:

EXEC SQL DECLARE mycursor CURSOR WITH HOLD FOR...  END-EXEC

 

OpenESQL slow performance on cursor close using ADO.NET with SQL Server

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Chris Glazier on 4/25/2014 7:59:39 PM

Problem:

Customer has a Visual COBOL managed .NET application which uses OpenESQL with the DBMAN=ADO directive set.

The application declares a cursor that returns a large number of rows.

When the cursor is opened and the rows are fetched the performance is very good but when the CLOSE statement is issued for the cursor it can take several seconds to return.

What is causing this slowdown and how can it be improved?

Resolution:

This type of behavior can occur if you are defining a forward only read only cursor and only the first few rows are being read, ie a large number of rows are being left unread at close time. This is a scenario in which SQL Server is known to perform badly. The reason is in the design of the TDS protocol which returns the entire result set in a single response with no easy way for a client to stop the flow of rows from the server, so typically the provider will just sit in a loop discarding rows that the application doesn’t need. There are two possible workarounds.

1. Limit the number of rows returned by either fine tuning the WHERE clause or using SELECT TOP.
2. Switch to a server cursor by using DECLARE c FAST FORWARD CURSOR FOR

(2) will improve CLOSE time at the expense of slower OPEN and FETCH times because a server cursor only returns rows when the client requests them, so there is no overhead abandoning the remainder of the result set.

However, since OpenESQL with BEHAVIOR=MAINFRAME buffers 8 rows at a time by default the performance hit shouldn’t be too bad and overall you should see a net gain.

Pro*COBOL application reports RTS 114 error when using INITCALL"ORASQL11" in 64-bit

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Chris Glazier on 4/25/2014 7:59:49 PM

Problem:

Customer has a Visual COBOL application that uses Oracle's Pro*COBOL product to access their Oracle database. When they compile the programs they use the directive INITCALL"ORASQL11". This will cause a CALL "ORASQL11" statement to be inserted into the beginning of the program in oder to load the Pro*COBOL run-time system orasql11.dll.

This works fine in 32-bit but when compiling for 64-bit and using the 64-bit version of Pro*COBOL the application is failing with a RTS 114 error when it is run.

What is the problem with 64-bit?

Resolution:

It appears that the 64-bit version of the Pro*COBOL run-time system does not contain an actual entry point called ORASQL11 whereas the 32-bit version does.

When a CALL statement is executed for an entry point that is not loaded the .dll with that name will be loaded automatically and then the entry point with the same name will be called. If there is no entry point with that name then the entry point with the lowest ordinal number within the .dll will be called and if that is expecting parameters it will result in the RTS 114 error.

To get around this, the Oracle run-time system can be loaded without calling its entry point by removing the INITCALL"ORASQL11" directive and adding the following code to the first program of the application:

01 proc-point  procedure-pointer.

     set proc-point to entry "ORASQL11"

 


Program calling FHREDIR directly reports invalid format error if target is AnyCPU

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Chris Glazier on 4/25/2014 7:59:58 PM

Problem:

Customer has a managed .NET application that calls the external file handler directly through fileshare by doing:
     CALL "FHREDIR" ...
This works fine when compiled to a target platform of x86 or x64 but when the platform is set to AnyCPU the program will report an invalid format exception error when the CALL statement is executed.

Why does this occur and is there a workaround for this?

Resolution:

The problem is that the FHREDIR assembly does a p/invoke to call in the required native code CCI modules.

The CCITCP.dll (or anything that is platform invoked) is loaded from the system PATH. So, if the project is AnyCPU and is executed on a 64-bit machine then you would need to run it from a 64-bit Visual COBOL command prompt or at least make sure all the required 64-bit native DLLs (ccitcp.dll and mfcrptlib.dll in this case) are on the PATH or in the current directory.

The 64-bit versions of these files are found in the folder: C:\Program Files (x86)\Micro Focus\Visual COBOL for Visual Studio 2012\bin64

This either has to be first in the path or you can copy the two files mentioned above to your output folder.

On a 32-bit machine you will have to use the 32-bit version of these .dlls.

How to extract the License Server installation from Visual Cobol 2.2

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Robert Milligan on 4/28/2014 3:51:47 PM

Problem:

In runtime version Server 2.1 Update 1 and earlier, it was possible to perform an independent installation for the Liense Server, by extracing it from the installation file using the -ExtractCab switch.

In version 2.2 this switch is no longer available, so how is this performed with version 2.2?

Resolution:

Attached to this article is an archive called "6644.dark.zip".

This utility is part of the WiX toolset, which can be used to create MSI’s and wrapper EXE’s.

Decompress the attached zip and run, for example:

 >dark.exe -x d:\decomp cs2010_22.exe

where:

d:\decomp is the folder where you want the files extracted to.

cs2010_22.exe is the "Cobol Server 2.2 for Visual Studio 2010" software executable.

Inside d:\decomp, is an ‘AttachedContainer’ folder which in turn has the various MSI’s and pre-requisite EXE’s.  The license server installation software is located in the sub-folder called lmsetup where lmsetupx86.msi is the 32-bit installer and lmsetupx64.msi is the 64-bit installer.

6644.dark.zip

COBCH1712 has no visible instance method 'value' with 0 parameters errors seen after upgrading to Visual COBOL 2.2 Update 1

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Kim.Hoskin on 5/16/2014 12:28:45 PM

Problem:


After upgrading Visual COBOL to Version 2.2 Update 1 the following error may be encountered when using Managed Code Projects where code does not use specific properties of a method:

COBCH1712 <object type> has no visible instance method '<value>' with 0 parameters.



Resolution:

The release notes of Visual COBOL 2.2 Update 1 state:

In member reference in managed COBOL syntax, parentheses can only be used when referencing methods.

Parentheses can no longer be used when referencing fields or properties, as this will produce a syntax error.

For example:

     set intLength to testString::Length()

must change to:

     set intLength to testString::Length

Unable to install Visual COBOL 2.2 Hotfix 5

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Matthew Coronado on 12/10/2014 2:29:38 PM

Problem:

Visual COBOL 2.2 for Visual Studio 2010 Hotfix 5 cannot coexist on the same machine with
Visual COBOL 2.2 for Visual Studio 2012 Hotfix 5.

Resolution:

Both versions cannot be installed at the same time.

Either Visual COBOL 2.2 for Visual Studio 2010 Hotfix 5 or 

          Visual COBOL 2.2 for Visual Studio 2012 Hotfix 5 will need to be installed alone.

The end user will need to be determined which they require.

Visual Studio 2012 compatibility issues after installation

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Matthew Coronado on 12/10/2014 2:35:46 PM

Problem:

In Visual Studio 2012, when installing Enterprise Developer or Visual COBOL, Windows versions greater than and including Windows 7 reports an issue (pictured below) which requires a Visual Studio 2012 update to be downloaded from Microsoft to resolve.

Resolution:

This is a Microsoft known problem.

To resolve it, follow the instructions in the notification for obtaining help online, or download the KB2781514 update for Visual Studio 2012 from the Microsoft Download Center.

 

Viewing all 214 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>