View previous topic :: View next topic
|
Author |
Message |
jimmybhandari
New User
Joined: 04 Jun 2009 Posts: 13 Location: bangalore
|
|
|
|
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 |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Yes
Are you ready to dig into data areas? |
|
Back to top |
|
|
jimmybhandari
New User
Joined: 04 Jun 2009 Posts: 13 Location: bangalore
|
|
|
|
Yes , that wold be fine. Please provide the solution.
Thanks
Jimmy |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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.
Bill |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
for LISTDSI the dataset has to reside on a direct access storage device.
Gerry |
|
Back to top |
|
|
|