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

Record length based on a Copy book


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

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Wed Jun 18, 2008 7:18 pm
Reply with quote

Hi,

I have to calculate record length of a file based on a copy book.

I have the following cases in it--

15 Acc-Rec Pic X(02).

15 New-Acc-Rec Redefines Acc-Rec Pic X(02).
***********************************************************

15 Product-Code Pic X(04).

15 New-Product-Code Redefines Product-Code Pic X(05).


To determine the record length----

In the first case of Acc-Rec , do i need to claculate 2 bytes again?

In the second case i.e., Product code, the redefined varaible has one more extra byte so how should i deal there.

If, in case there is a scenario where redefined variable size is lesser than what it redefines then what to do ?

If, a variable is alphanumeric and redefines a numeric variable with different permutations and combinations of sizes then how to deal in such cases?

Thanks.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jun 18, 2008 7:34 pm
Reply with quote

Do a compile with the MAP option and it will show you the length in the listing.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Jun 18, 2008 7:41 pm
Reply with quote

Hi Meenakshi !

A easy-peasy way is to include that copybook in a programm. Complile the programm and look at the generated listing. There it is, the length.

And looking there, you can all answer your questions by yourself.
Good luck !
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Thu Jun 19, 2008 12:35 pm
Reply with quote

I compile the code with compiler option MAP.

In the compiler listing "SYSUT2 COMPILE" , the
below copybook COPY IDMS APPLCNT is expanded.

But where to find the record length in compiler listing?

Regards
R KARTHIK
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Jun 19, 2008 12:40 pm
Reply with quote

Hello,

Quote:
below copybook COPY IDMS APPLCNT is expanded.
Scroll down to where the copy expansion begins and scroll to the right.
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Thu Jun 19, 2008 12:52 pm
Reply with quote

Hi .

Ya .. I found that .

033400* COPY IDMS WK-DOHBPA13-APPLCNT-LN-EXTC.
01 WK-APPLCNT-CLM-LN-EXTC-RECORD. BLW=00004+020 0CL1371
Back to top
View user's profile Send private message
prem_ibm

New User


Joined: 15 Sep 2007
Posts: 31
Location: Chennai

PostPosted: Thu Jun 19, 2008 2:07 pm
Reply with quote

Hi karthikr44

Can you please let us know what length have got in Compile listing for the variable which u have mentioned in u r query.

Thanks

Prem
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Thu Jun 19, 2008 6:05 pm
Reply with quote

In query i give APPLCNT instead of WK-DOHBPA13-APPLCNT-LN-EXTC wrongly.
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 Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top