Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COBOL File Declaration for RECFM=VBS in JCL !!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: COBOL File Declaration for RECFM=VBS in JCL !!
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: 7914
Location: Bellevue, IA

PostPosted: Fri Apr 03, 2015 5:25 pm    Post subject:
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    Post subject: Reply to: COBOL File Declaration for RECFM=VBS in JCL !!
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: 7914
Location: Bellevue, IA

PostPosted: Fri Apr 03, 2015 11:01 pm    Post subject:
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 User


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

PostPosted: Fri Apr 03, 2015 11:16 pm    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us