View previous topic :: View next topic
|
Author |
Message |
thinkmsk
New User
Joined: 03 Apr 2015 Posts: 2 Location: India
|
|
|
|
Hi Friends,
We have used the MQ utility CSQUTIL to copy the messages from a local queue (MQ) to a GDG file which has below declaration in JCL. Now, we have been requested to write a new COBOL-MQ to program to copy the messages from the local queue which has maximum length of 4194304 and to write the same to a GDG file as it is doing for CSQUTIL:
DD DSN=TCC.TST.DOWNLOAD.QUEUE(+1),
DISP=(NEW,CATLG,DELETE),
UNIT=SYSDA, SPACE=(TRK,(1,1,0),RLSE),
DCB=(RECFM=VBS,BLKSIZE=23200)
We have written the COBOL-MQ program but we are not sure how to write a COBOL FD file declaration in our program for RECFM=VBS matching the above GDG file declaration in JCL.
Could you please help me in providing the COBOL FD File declaration for RECFM=VBS to write records with maximum length of 4194304 bytes ?
Thanks a lot in advance !! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Could you please help me in providing the COBOL FD File declaration for RECFM=VBS to write records with maximum length of 4194304 bytes ? |
Find the Language Reference manual for the version of Enterprise COBOL you have and peruse Appendix B Compiler Limits. You will discover that an FD entry (at least for the 5.2 version) can be no more than 1,048,575 bytes -- but note 5 applies and indicates that 1048575 is a compiler limit and QSAM limits you to 32760 bytes. In other words, it is not possible to use a record length of 4194304 in COBOL on z/OS. |
|
Back to top |
|
|
thinkmsk
New User
Joined: 03 Apr 2015 Posts: 2 Location: India
|
|
|
|
Hi Robert,
Thanks for your update. Could you please provide the FD File Declaration based on the below GDG file details used in JCL since this is the first time to work in batch program. So that I can give a try to execute and see..
DD DSN=TCC.TST.DOWNLOAD.QUEUE(+1),
DISP=(NEW,CATLG,DELETE),
UNIT=SYSDA, SPACE=(TRK,(1,1,0),RLSE),
DCB=(RECFM=VBS,BLKSIZE=23200) |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Hopefully, you realize by now that any record over 32760 bytes long may not be readable on the mainframe. I wrote a program a few years back to read SMF data, which is VBS as well. The COBOL declarations for that data set are:
Code: |
000100 SELECT SMF-FILE ASSIGN TO SMFIN
000110 FILE STATUS IS WS-SI-FS.
000180 DATA DIVISION.
000190 FILE SECTION.
000200 FD SMF-FILE RECORDING MODE S
000210 RECORD VARYING FROM 14
000220 TO 32763
000230 DEPENDING ON WS-SI-LENGTH
000240 BLOCK CONTAINS 32767
000250 LABEL RECORDS STANDARD.
000260 01 SMF-MIN-RECORD.
000270 05 PIC X(14).
000280
000290 01 SMF-MAX-RECORD.
000300 05 PIC X(32763).
000310
000320 01 SMF-VAR-RECORD.
000330 05 SVR-DATA OCCURS 14 TO 32763
000340 DEPENDING ON WS-SI-LENGTH
000350 PIC X(01).
000360 |
I pulled a few lines for other files just to show the SMF file. You will need to set the limits based on your data. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
The DD statement you show may not be valid anyway. A VBS data set opened for output must specify an LRECL that specifies the maximum length logical record you intend to write.
In theory an Assembler program can read or write variable length logical records > 32767 bytes, but I never got anything like that to work, though I'll admit I didn't try very hard.
I've done a number of Assembler programs to read and/or write SMF data. I specify LRECL=32767 in the program's DCB macro when writing SMF data - JCL won't accept the value - and don't have any real trouble. What Cobol does I have no idea. |
|
Back to top |
|
|
natt.sut
New User
Joined: 01 Nov 2017 Posts: 8 Location: Thailand
|
|
|
|
I would like to know that the concept and syntax to write VBS file is the same as VB file format? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
First, when you have a new question do not add to the end of an old topic -- start a new one.
Second, do not post the same question multiple times in the forum; responses will be provided to the single question and posting additional questions on the same time usually just gets people upset at the waste of their time.
Topic locked. |
|
Back to top |
|
|
|