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