Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Method to find the length of copybook
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
ManjulaRajamurugan

New User


Joined: 28 Apr 2008
Posts: 4
Location: Hyderabad

PostPosted: Mon Apr 28, 2008 3:39 pm    Post subject: Method to find the length of copybook
Reply with quote

Hi,
Is there any method to find the length of copybooks? other than counting the length of individual fields included in that copybook?
Back to top
View user's profile Send private message
References
PostPosted: Mon Apr 28, 2008 3:39 pm    Post subject: Re: Method to find the length of copybook Reply with quote

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 1784
Location: Israel

PostPosted: Mon Apr 28, 2008 3:44 pm    Post subject:
Reply with quote

Do you have FileAid?

O.
Back to top
View user's profile Send private message
mytags

Active User


Joined: 28 Apr 2008
Posts: 60
Location: US

PostPosted: Mon Apr 28, 2008 3:47 pm    Post subject:
Reply with quote

By using listcatentries in the Copy book list we can find the length of the copy book.
Back to top
View user's profile Send private message
ManjulaRajamurugan

New User


Joined: 28 Apr 2008
Posts: 4
Location: Hyderabad

PostPosted: Mon Apr 28, 2008 3:51 pm    Post subject:
Reply with quote

may i know where to give it? that listcatentries?
Back to top
View user's profile Send private message
ManjulaRajamurugan

New User


Joined: 28 Apr 2008
Posts: 4
Location: Hyderabad

PostPosted: Mon Apr 28, 2008 3:54 pm    Post subject:
Reply with quote

also can we find it using option 3 and then 13?
Back to top
View user's profile Send private message
mytags

Active User


Joined: 28 Apr 2008
Posts: 60
Location: US

PostPosted: Mon Apr 28, 2008 4:02 pm    Post subject:
Reply with quote

After entering your Pds name in option 3.4 we will get a list of copy books included in this pds,within the command line we can type 'listcat entries(/) all' then we can see the full details including its length.
With Regards,
Hari
Back to top
View user's profile Send private message
ManjulaRajamurugan

New User


Joined: 28 Apr 2008
Posts: 4
Location: Hyderabad

PostPosted: Mon Apr 28, 2008 4:03 pm    Post subject:
Reply with quote

ok thanks
Back to top
View user's profile Send private message
mytags

Active User


Joined: 28 Apr 2008
Posts: 60
Location: US

PostPosted: Mon Apr 28, 2008 4:04 pm    Post subject:
Reply with quote

'Welcome'
Manjula

With regards
Hari
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1050
Location: germany

PostPosted: Mon Apr 28, 2008 4:14 pm    Post subject:
Reply with quote

not really sure how listcat can provide you a list of lengths that are derived by adding element lengths.

are you not just receiving a list of number of records (lines) in each copybook?

normally, looking at a compile listing will provide you the length.

I have a special program that has nothing except copy statements in linkage section. that means the compiler will start at relative zero for each level 01 encounterd, thus displacements (relative locations) are oriented to the begining of the copybook.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 256
Location: Spain

PostPosted: Mon Apr 28, 2008 4:23 pm    Post subject:
Reply with quote

what about ?
Quote:
DISPLAY LENGTH OF yourcopybook
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1470

PostPosted: Mon Apr 28, 2008 7:45 pm    Post subject:
Reply with quote

acevedo,

Not sure about this but I think "LENGTH OF" needs a variable name.

Maybe:
DISPLAY LENGTH OF 01 level in yourcopybook ?

PS to Manjula:
Some copybooks may have multiple 01 levels.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 256
Location: Spain

PostPosted: Mon Apr 28, 2008 9:01 pm    Post subject:
Reply with quote

our standards says: if any, only one 01 level por copybook.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1470

PostPosted: Mon Apr 28, 2008 10:05 pm    Post subject:
Reply with quote

The PS was for Manjula.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 256
Location: Spain

PostPosted: Tue Apr 29, 2008 11:47 am    Post subject:
Reply with quote

My reply was not the result of thinking that PS was for me, it was just a comment.
Back to top
View user's profile Send private message
Bill O'Boyle

Active User


Joined: 14 Jan 2008
Posts: 210
Location: Orlando, FL, USA

PostPosted: Wed Apr 30, 2008 2:56 am    Post subject: Re: Method to find the length of copybook
Reply with quote

The following is primarily for OS/VS COBOL but can certainly be used in COBOL2 and greater.

You could call the following sub-program 'GETLGTH', passing four binary-fword parameters.
Code:

01  WS-GETLGTH PIC X(08) VALUE 'GETLGTH'.
01  WS-FIELD-LGTH PIC 9(08) COMP.
01  WS-BOOK-LGTH PIC 9(08) COMP.
01  WS-COPYBOOK-START.
    03..........
    03..........
    03..........
    03 WS-LAST-FIELD PIC X(20).
*
MOVE 20 TO WS-FIELD-LGTH.
*
CALL WS-GETLGTH USING WS-COPYBOOK-START,
                      WS-LAST-FIELD,
                      WS-FIELD-LGTH,
                      WS-BOOK-LGTH.

After return back from "GETLGTH", WS-BOOK-LGTH will contains the overall length from the first byte of WS-COPYBOOK-START through the last byte of WS-LAST-FIELD.
Code:

GETLGTH  CSECT                                                           
         USING *,R3                INFORM ASSEMBLER                       
         SAVE (14,12)              SAVE REGISTERS                         
         LA    R3,0(,R15)          R3 IS BASE                             
         LM    R5,R8,0(R1)         PARM-ADDRESSABILITY                   
         LA    R8,0(,R8)           CLEAR TOP-BIT                         
         L     R6,0(,R6)           END-ADDRESS INTO R6                   
         S     R6,0(,R5)           SUBTRACT START-ADDRESS FWORD           
         A     R6,0(,R7)           ADD LAST-FIELD'S FWORD-LGTH           
         BCTR  R6,0                REDUCE BY 1                           
         ST    R6,0(,R8)           STORE IN 4TH-PARM                     
         LA    R15,0               SET RETURN-CODE                       
         CR    R6,R15              EXCEEDS ZERO?                         
         BH    RTN2CLLR            YES, RETURN TO CALLER                 
         ST    R15,0(,R8)          ENSURE X'00'S                         
         LA    R15,16              SET RETURN-CODE                       
RTN2CLLR EQU   *                                                         
         RETURN (14,12),RC=(15)    RESTORE AND RETURN                     
GETLGTH  AMODE 31                                                         
GETLGTH  RMODE ANY                                                       
         YREGS                     REGISTER-EQUATE MACRO                 
         END   ,                   END 'GETLGTH'                         

HTH....

Regards,

Bill
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 HoursGoto page 1, 2, 3  Next
Page 1 of 3