IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COBOL File Declaration for RECFM=VBS in JCL !!


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
thinkmsk

New User


Joined: 03 Apr 2015
Posts: 2
Location: India

PostPosted: Fri Apr 03, 2015 3:31 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 03, 2015 5:25 pm
Reply with quote

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
View user's profile Send private message
thinkmsk

New User


Joined: 03 Apr 2015
Posts: 2
Location: India

PostPosted: Fri Apr 03, 2015 5:40 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 03, 2015 11:01 pm
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Apr 03, 2015 11:16 pm
Reply with quote

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
View user's profile Send private message
natt.sut

New User


Joined: 01 Nov 2017
Posts: 8
Location: Thailand

PostPosted: Sun Nov 12, 2017 7:09 am
Reply with quote

I would like to know that the concept and syntax to write VBS file is the same as VB file format?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sun Nov 12, 2017 8:26 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
Search our Forums:

Back to Top