Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to Determine the record length of a File in a JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 90
Location: Spain

PostPosted: Tue Nov 17, 2009 4:06 pm    Post subject: How to Determine the record length of a File in a JCL
Reply with quote

Hello.

As simple as it might seem i neveer needed to that until now.

I Need to change a critical copy at my shop and extend it's length to add new fields that will be used by some applications in the first stance and maybe others in the future. Tha's why we'll extend it from 300 to 500 bytes. The problem is that there is a lot of software compiled with that copy and I was told that they won't change it at this time because of time or other issues. Therefore my idea.

If I Can read the record length in a JCL Batch Job of an input FB file, and determine if it is 300 bytes, I could easily alter that file to make it 500 bytes long and use it on my processess without much problem and the minimum impact on their apps until they need to recompile their processess when they'll have to adapt to out jobs

I though on using listcat, but I'm not sure how to extract that info.

I'm sorry if this is a silly question, but well, it would save me a lot of time since . Any suggestions?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 17, 2009 4:37 pm    Post subject:
Reply with quote

Input files in JCL are usually cataloged, so they do not have LRECL specified. Unless you can find the source code for the program being executed, determine from the source code the expected record length for the file, and proceed from there, you cannot know the LRECL. What you are wanting to do can be done but not easily -- it would probably be less effort to go ahead and change all programs that use the file to use the new record length.
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 90
Location: Spain

PostPosted: Tue Nov 17, 2009 6:09 pm    Post subject:
Reply with quote

Robert Sample wrote:
Input files in JCL are usually cataloged, so they do not have LRECL specified. Unless you can find the source code for the program being executed, determine from the source code the expected record length for the file, and proceed from there, you cannot know the LRECL. What you are wanting to do can be done but not easily -- it would probably be less effort to go ahead and change all programs that use the file to use the new record length.


Indeed the files are catalogued. I was hopping that, since writing an "S" next to a file, it gives me all the info associated with it, record length included, i could do what i wanted.

We wanted to minimize the resistance from the other apps to change their sofware because of a need of our application in which they are affected and would be forced to change a huge amount of JCLs and Cobol Programs. What we wanted was a "way" to access the catalog and retrieve this data

That way, I would be able to determine if a file is being written with the new or old copy, and i could take the proper measures. I need to do this, beucase I recive a "file of files", an 80bytes fixed length file with the name of many files which will be processed, and they are the ones affected by this change.

Anyway, is there no way to get this information in a Batch JCL?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Nov 17, 2009 6:16 pm    Post subject:
Reply with quote

From what I can see here, you want to change the file for ONE program to append values after the current 300 byte point.

Would it not be easier to run the program and create the new file, and then run a sort step to create the standard 300 byte file. That way you have the two files, one of 300 bytes that can be used as usual, and the new file of 500 bytes that can be used by the application(s) that have been changed or designed to accept this file.

Of course, if the changes occur before the 300 byte point then you need to change everything.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue Nov 17, 2009 6:16 pm    Post subject: Reply to: How to Determine the record length of a File in a
Reply with quote

Here's a few topics with some ideas:

http://www.ibmmainframes.com/viewtopic.php?t=44599
http://www.ibmmainframes.com/viewtopic.php?t=11604
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 90
Location: Spain

PostPosted: Wed Nov 18, 2009 2:18 pm    Post subject:
Reply with quote

Thanks for the links superk. The second one was right on what i needed.

I'd like to clarify thhough, what is what I'm intending to do.

We have a process, in which we process accounting info from all the applications in the shop. This process works in the following way:

Each application generates a 300 bytes length file with their movements. They add the "file name" to another file. As for the file format, we suppliead each application with a General purpose copy (Lets say, copy A) of 300 bytes length.

We then, process this "File of names" file to read each data file and add it to our internal accounting process. Our process is ready to process each 300 bytes file. The problem is that in the last census, there are over 2000 programs that use that copy and well, the cost of changing all that software is way too expensive.

We need to change that copy struct to add "new" fields at the end of it. What we though was:

Well, let's let them use the old copy and the ones that need to use the new fields use the new one when they recompile their programs. That way, once their program compiles they'll change their jobs accordingly and generate it with the new 500 bytes lenght format and the othes in the old 300 bytes length format.

Whe we wanted to do in our process was read each file in the "file of files", and if it was create with a length of 300 bytes, change it to 500 bytes, using a sort, maybe, and the ones of 500 bytes, well, we'll just let them be. That way the others applications won't be affected by the change in the first instance, and we can go on with our requirement on our side. What do you think of this approach? I hope it was clear enough.
Back to top
View user's profile Send private message
darkstar13

New User


Joined: 06 Nov 2008
Posts: 46
Location: Manila, Philippines

PostPosted: Thu Nov 19, 2009 9:30 am    Post subject: Reply to: How to Determine the record length of a File in a
Reply with quote

Hi OJ,
I agree with expat.
I believe it's easier to just create the 500-byte file, and for the processes that need the 300-byte file, just use sort to extract the first 300 bytes of the 500-byte file.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Nov 19, 2009 9:54 am    Post subject:
Reply with quote

Hello,

When the file is created, you might consider creating the data in both lengths with different dataset names. Once the last of the "old" programs have been converted to the new format, only 1 file would be needed.

The "old" stuff could use the existing dsn (to minimize changes) and the neew/chaged processes (needing to be changed anyway) would use the new dsn.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us