Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to convert FB file to VBS32760 file?
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.


Report this thread to moderator Post Follow-up to this message
Old Post
onelxii
03-22-06 08:55 AM


Re: How to convert FB file to VBS32760 file?
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.

Report this thread to moderator Post Follow-up to this message
Old Post
Joe Zitzelberger
03-22-06 12:55 PM


Re: How to convert FB file to VBS32760 file?
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


Report this thread to moderator Post Follow-up to this message
Old Post
Robert Jones
03-22-06 11:55 PM


Re: How to convert FB file to VBS32760 file?
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.
>

Report this thread to moderator Post Follow-up to this message
Old Post
JimmyMac
03-22-06 11:55 PM


Re: How to convert FB file to VBS32760 file?
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..


Report this thread to moderator Post Follow-up to this message
Old Post
onelxii
03-25-06 02:55 AM


Re: How to convert FB file to VBS32760 file?
You are kidding !

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

Report this thread to moderator Post Follow-up to this message
Old Post
Bill TB
03-26-06 12:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:16 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.