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

How to get the record length for input file from jcl dd


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jimmybhandari

New User


Joined: 04 Jun 2009
Posts: 13
Location: bangalore

PostPosted: Fri Aug 14, 2009 10:41 pm
Reply with quote

Hi all,

Is there a way to get the input record length for a sequential input/output file from the dd parameters of jcl in a cobol program.

The problem is that every time i run the program, i need to pass an input file having different record length and then write selected records to the output. i.e. the input and output record length needs to be supplied while executing the load module.

Jimmy
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Fri Aug 14, 2009 10:48 pm
Reply with quote

Yes

Are you ready to dig into data areas?
Back to top
View user's profile Send private message
jimmybhandari

New User


Joined: 04 Jun 2009
Posts: 13
Location: bangalore

PostPosted: Fri Aug 14, 2009 10:58 pm
Reply with quote

Yes , that wold be fine. Please provide the solution.

Thanks
Jimmy
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Aug 15, 2009 2:14 am
Reply with quote

read this
ibmmainframes.com/viewtopic.php?t=35300&highlight=ucb
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sat Aug 15, 2009 2:19 am
Reply with quote

How many different record lengths are you talking about? Do you know all the possible ones ahead of time or does your program need to determine the record length no matter what it is (completely blind)?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Sat Aug 15, 2009 4:13 am
Reply with quote

How about a callable REXX routine (from COBOL), which issues a LISTDSI function against each file?

Review this previous post (COBOL calling REXX) -

www.ibmmainframes.com/about24412.html

LISTDSI returns a great deal of file-information, with LRECL being one and it will keep you away from having to write and maintain (key issue for management nowadays) an Assembler sub-program. icon_wink.gif

Bill
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Sat Aug 15, 2009 5:54 am
Reply with quote

If you are running this in an ISPF environment (foreground or batch) it is just a call to the QBASELIB service to get the dsname and then the DSINFO service to get the lrecl.

Otherwise, try searching the web for COBOL examples that search the TIOT for a JFCB. It isn't a whole lot of code, but it it isn't really straight forward because the code I've seen simulates the SWAREQ macro which (directions for doing this used to be in the MVS Diagnosis manual and might still be) and for a JFCB to be valid, the ddname has to have been opened at least once. Or you can drop down to assembler and call a small program to do a CAMLST LOCATE, usually about 20 lines or so of assembler. The CBT tape probably has something you can find too.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Aug 17, 2009 7:50 am
Reply with quote

Hi,


for LISTDSI the dataset has to reside on a direct access storage device.


Gerry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic 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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top