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
 

 

Method to find the length of copybook
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
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

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
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

New User


Joined: 28 Apr 2008
Posts: 63
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

New User


Joined: 28 Apr 2008
Posts: 63
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

New User


Joined: 28 Apr 2008
Posts: 63
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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

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: 344
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: 1592

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: 344
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: 1592

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: 344
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

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, 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
PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Wed Apr 30, 2008 3:27 am    Post subject:
Reply with quote

http://groups.google.be/group/bit.listserv.tsorexx/browse_thread/thread/d60c97b35839e3ff/bdcec8b86fb6ecae?lnk=gst&q=rexx+record+calculation#bdcec8b86fb6ecae
See first thread.

Tribute of Mark Harrington.

Just perfect.

Regards
Pierre
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: Thu May 01, 2008 2:18 am    Post subject: Re: Method to find the length of copybook
Reply with quote

Sincere apologies to one and all regarding the GETLGTH Assembler sub-program previously posted. I must have had my head up my A$$ because this previous version WILL NOT WORK and with that, please use the replacement GETLGTH sub-program below.

The Caller's parmlist of four arguments remains the same.

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    R5,0(,R5)           CLEAR TOP-BIT                         
         LA    R6,0(,R6)           SAME                                   
         LA    R7,0(,R7)           SAME                                   
         LA    R8,0(,R8)           SAME                                   
         XC    0(4,R8),0(R8)       ENSURE X'00'S                         
         LR    R1,R6               LOAD END-ADDRESS                       
         SLR   R1,R5               REDUCE BY START-ADDRESS               
         AL    R1,0(,R7)           ADD LAST-FIELD'S LGTH                 
         LA    R15,16              SET 'BAD' RETURN-CODE                 
         CHI   R1,0                NEGATIVE?                     
         BL    RTN2CLLR            YES, RETURN TO CALLER
         LA    R15,8               RESET RETURN-CODE
         BE    RTN2CLLR            RETURN WHEN ZERO           
         ST    R1,0(,R8)           STORE RESULT IN 4TH-PARM               
         SLR   R15,R15             ALL IS WELL                           
RTN2CLLR EQU   *                                                         
         RETURN (14,12),RC=(15)    RESTORE AND RETURN                     
GETLGTH  AMODE 31                                                         
GETLGTH  RMODE ANY                                                       
         YREGS                     REGISTER-EQUATE MACRO                 
         END   ,                   END 'GETLGTH'                         

Slowly wiping egg from face.... icon_redface.gif

Bill
Back to top
View user's profile Send private message
sudhaaa

New User


Joined: 24 Mar 2005
Posts: 51

PostPosted: Fri May 02, 2008 6:51 pm    Post subject:
Reply with quote

If you have Fileaid, use option 3.8

Thanks,
Sudhaaa
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Sat Jun 21, 2008 1:14 am    Post subject: From fileaid
Reply with quote

Option 8 (XREF) will give you the length !!
Back to top
View user's profile Send private message
Pankaj Gupta
Currently Banned

New User


Joined: 07 May 2008
Posts: 50
Location: Bangalore

PostPosted: Sat Jun 21, 2008 5:04 am    Post subject:
Reply with quote

Quote:
DISPLAY LENGTH OF yourcopybook

Hello, but I am having a doubt about this syntaxes. The compiler it is not compiling "LENGTH OF". Also before I am mentioned that it is also not liking the EVALUATES syntax. Is the LENTH OF the valid COBOLs?
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm


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