For Programmers: Free Programming Magazines  


Home > Archive > Cobol > March 2006 > How to convert FB file to VBS32760 file?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to convert FB file to VBS32760 file?
onelxii

2006-03-22, 3:55 am

Hi everyone.. I've been working as cobol programmer on OS/390
environment for sometime but this is the first time that I will have to
create a variable block output file with record length 32760 from a FB
file. The main reason for converting it to VBS32760 is that our system
only handles the transmission of VBS32760 files. Anyway, I have
successfully created the VBS32760 following some of the guidelines in
the earlier group topics but the problem arose when I submitted the job
to transmit the file. Although the jobrun was successful, the block
count transmitted showed that only 1 block was read as input and
subsequently sent out. This was confirmed by the recepient of the file
as they reported that the file was empty. Do you guys have any idea on
the proper way to variably block a fixed block to 32760? I've attached
below the program declaration and routines inside the conversion
program. Thanks a lot..

FILE SECTION.
FD CDF-MERGED-FILE.
01 CDFMRG-REC PIC X(10000).
FD CDF-MERGED-FILE-VB
BLOCK CONTAINS 0 RECORDS
RECORDING MODE IS S.
01 CDFMRGVB-REC.
05 CDFMRGVB-REC-X PIC X OCCURS 32756 TIMES
DEPENDING ON CDF-LEN.
01 CDFMRGVB-REC-MAX PIC X(32756).
WORKING-STORAGE SECTION.
01 OTHER-VARIABLES.
05 CDF-LEN PIC 9(8) COMP.
05 WS-CDFMRGVB-STATUS PIC 9(2) VALUE ZEROES.
05 WS-CDFMRG-STATUS PIC 9(2) VALUE ZEROES.
05 EOF-CDF PIC 9(1) VALUE ZEROES.

000-MAIN-RTN SECTION.
000-MAIN.
MOVE 32756 TO CDF-LEN.
READ CDF-MERGED-FILE AT END MOVE 1 TO EOF-CDF.
PERFORM 100-PROCESS-CDFMRG-RTN UNTIL EOF-CDF = 1.
000-STOP.
STOP RUN.

100-PROCESS-CDFMRG-RTN SECTION.
100-PROCESS-CDFMRG.
MOVE CDFMRG-REC TO CDFMRGVB-REC.
WRITE CDFMRGVB-REC.
DISPLAY CDFMRGVB-REC.
READ CDF-MERGED-FILE AT END MOVE 1 TO EOF-CDF.
100-EXIT.
EXIT.

Joe Zitzelberger

2006-03-22, 7:55 am

Try:

//S1 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=YOUR.FB.DS.HERE
//SYSUT2 DD DISP=(NEW,CATLG),DSN=YOUR.VBS.DS.HERE,
// LRECL=32760,RECFM=VBS


In article <1143015616.303730.67860@z34g2000cwc.googlegroups.com>,
"onelxii" <onelxii@yahoo.com> wrote:

> Hi everyone.. I've been working as cobol programmer on OS/390
> environment for sometime but this is the first time that I will have to
> create a variable block output file with record length 32760 from a FB
> file. The main reason for converting it to VBS32760 is that our system
> only handles the transmission of VBS32760 files. Anyway, I have
> successfully created the VBS32760 following some of the guidelines in
> the earlier group topics but the problem arose when I submitted the job
> to transmit the file. Although the jobrun was successful, the block
> count transmitted showed that only 1 block was read as input and
> subsequently sent out. This was confirmed by the recepient of the file
> as they reported that the file was empty. Do you guys have any idea on
> the proper way to variably block a fixed block to 32760? I've attached
> below the program declaration and routines inside the conversion
> program. Thanks a lot..
>
> FILE SECTION.
> FD CDF-MERGED-FILE.
> 01 CDFMRG-REC PIC X(10000).
> FD CDF-MERGED-FILE-VB
> BLOCK CONTAINS 0 RECORDS
> RECORDING MODE IS S.
> 01 CDFMRGVB-REC.
> 05 CDFMRGVB-REC-X PIC X OCCURS 32756 TIMES
> DEPENDING ON CDF-LEN.
> 01 CDFMRGVB-REC-MAX PIC X(32756).
> WORKING-STORAGE SECTION.
> 01 OTHER-VARIABLES.
> 05 CDF-LEN PIC 9(8) COMP.
> 05 WS-CDFMRGVB-STATUS PIC 9(2) VALUE ZEROES.
> 05 WS-CDFMRG-STATUS PIC 9(2) VALUE ZEROES.
> 05 EOF-CDF PIC 9(1) VALUE ZEROES.
>
> 000-MAIN-RTN SECTION.
> 000-MAIN.
> MOVE 32756 TO CDF-LEN.
> READ CDF-MERGED-FILE AT END MOVE 1 TO EOF-CDF.
> PERFORM 100-PROCESS-CDFMRG-RTN UNTIL EOF-CDF = 1.
> 000-STOP.
> STOP RUN.
>
> 100-PROCESS-CDFMRG-RTN SECTION.
> 100-PROCESS-CDFMRG.
> MOVE CDFMRG-REC TO CDFMRGVB-REC.
> WRITE CDFMRGVB-REC.
> DISPLAY CDFMRGVB-REC.
> READ CDF-MERGED-FILE AT END MOVE 1 TO EOF-CDF.
> 100-EXIT.
> EXIT.

Robert Jones

2006-03-22, 6:55 pm

Hello

The IEBGENER solution posted by Joe is best, but below are some
comments on your approach that may be helpful in other cases.

1) As well as the operating system, specify the particular compiler and
version in use, this can usually be found at the top of the source
listing.

2) Always include the Environment Division for questions about files,
it may also be helpful to include the Identification Division,
especially if the new options are being used. It is generally safer to
include them and risk providing a little too much info than too little,
they are not generally very large.

3) Use and check the file status for each file operation.
Alternatively, older compilers and maybe some current ones would
provide appropriate informative system messages, as long as the file
status checking was not specified for the specific files in the
Environment Division. If file status checking is specified in the
Environment Division, but not actually done in the Procedure Division,
then all file errors are just ignored at run time.

4) Don't try to display such vast records in their entirety, the key
portion, if any, or the first 20 characters or so would usually
suffice.

5) Keep counts of the records read and written and display those counts
at program termination.

6) Open and close the files that you are reading and writing
explicitly. This may not be essential for your compiler. the version
of which you didn't specify, but it makes file status checking easier.

7) Specify a record size of 32752 for a blocksize of 32760. Each
record needs a compiler generated leading 4 byte record length
descriptor, each block also needs a leading 4 byte record length
descriptor. I don't know what the maximum block size allowable is for
this type of file with your operating system and compiler, you could
look this up in the appropriate manual.

8) It used to be the case that the APPLY WRITE ONLY phrase/clause in
the Environment Division was beneficial for writing variable length
blocked files, but this may no longer be necessary for your compiler.
This phrase allowed the program to continue to write records that would
still fit in the block, whereas without it, the block would be written
when there wasn't room for a maximum size record.

Robert

JimmyMac

2006-03-22, 6:55 pm


Try The following:

If you DO get records but you get wrong length record errors adjust
the BLOCK CONTAINS DOWN BY 4 BYTES

good luck



FD CDF-MERGED-FILE-VB
BLOCK CONTAINS 32760 CHARACTERS
RECORDING MODE IS S.
01 CDFMRGVB-REC PIX X(10000).


Procedure Code:

000-MAIN.
READ CDF-MERGED-FILE AT END MOVE 1 TO EOF-CDF.
PERFORM 100-PROCESS-CDFMRG-RTN UNTIL EOF-CDF = 1.
000-STOP.
STOP RUN.

100-PROCESS-CDFMRG.
MOVE CDFMRG-REC TO CDFMRGVB-REC.
WRITE CDFMRGVB-REC.
DISPLAY CDFMRGVB-REC.
READ CDF-MERGED-FILE AT END MOVE 1 TO EOF-CDF.
100-EXIT.
EXIT.




onelxii wrote:
> Hi everyone.. I've been working as cobol programmer on OS/390
> environment for sometime but this is the first time that I will have to
> create a variable block output file with record length 32760 from a FB
> file. The main reason for converting it to VBS32760 is that our system
> only handles the transmission of VBS32760 files. Anyway, I have
> successfully created the VBS32760 following some of the guidelines in
> the earlier group topics but the problem arose when I submitted the job
> to transmit the file. Although the jobrun was successful, the block
> count transmitted showed that only 1 block was read as input and
> subsequently sent out. This was confirmed by the recepient of the file
> as they reported that the file was empty. Do you guys have any idea on
> the proper way to variably block a fixed block to 32760? I've attached
> below the program declaration and routines inside the conversion
> program. Thanks a lot..
>
> FILE SECTION.
> FD CDF-MERGED-FILE.
> 01 CDFMRG-REC PIC X(10000).
> FD CDF-MERGED-FILE-VB
> BLOCK CONTAINS 0 RECORDS
> RECORDING MODE IS S.
> 01 CDFMRGVB-REC.
> 05 CDFMRGVB-REC-X PIC X OCCURS 32756 TIMES
> DEPENDING ON CDF-LEN.
> 01 CDFMRGVB-REC-MAX PIC X(32756).
> WORKING-STORAGE SECTION.
> 01 OTHER-VARIABLES.
> 05 CDF-LEN PIC 9(8) COMP.
> 05 WS-CDFMRGVB-STATUS PIC 9(2) VALUE ZEROES.
> 05 WS-CDFMRG-STATUS PIC 9(2) VALUE ZEROES.
> 05 EOF-CDF PIC 9(1) VALUE ZEROES.
>
> 000-MAIN-RTN SECTION.
> 000-MAIN.
> MOVE 32756 TO CDF-LEN.
> READ CDF-MERGED-FILE AT END MOVE 1 TO EOF-CDF.
> PERFORM 100-PROCESS-CDFMRG-RTN UNTIL EOF-CDF = 1.
> 000-STOP.
> STOP RUN.
>
> 100-PROCESS-CDFMRG-RTN SECTION.
> 100-PROCESS-CDFMRG.
> MOVE CDFMRG-REC TO CDFMRGVB-REC.
> WRITE CDFMRGVB-REC.
> DISPLAY CDFMRGVB-REC.
> READ CDF-MERGED-FILE AT END MOVE 1 TO EOF-CDF.
> 100-EXIT.
> EXIT.
>

onelxii

2006-03-24, 9:55 pm

Hi all.. I couldnt find any other way to correctly convert the file and
as such I was informed by our vendor to just submit them the file in a
different format. At first they wanted me to give them a U or VB
format but both did not work so I ended up giving them a FB anyway. I
should not have bothered about the VBS in the first place.. Thanks for
all your help..

Bill TB

2006-03-26, 7:55 am

You are kidding !

onelxii wrote:
> Hi everyone.. I've been working as cobol programmer on OS/390
> environment for sometime

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com