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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to get the record length for input file from jcl dd
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: 456
Location: Belgium

PostPosted: Fri Aug 14, 2009 10:48 pm    Post subject:
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    Post subject:
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: 456
Location: Belgium

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

read this
http://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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Aug 15, 2009 4:13 am    Post subject: Reply to: How to get the record length for input file from j
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) -

http://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: 401
Location: Mumbai

PostPosted: Sat Aug 15, 2009 5:54 am    Post subject: Reply to: How to get the record length for input file from j
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: 1703
Location: Australia

PostPosted: Mon Aug 17, 2009 7:50 am    Post subject:
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    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


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