|
|
| Author |
Message |
ManjulaRajamurugan
New User
Joined: 28 Apr 2008 Posts: 4 Location: Hyderabad
|
|
|
|
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 |
|
 |
References
|
Posted: Mon Apr 28, 2008 3:39 pm Post subject: Re: Method to find the length of copybook |
 |
|
|
 |
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 1784 Location: Israel
|
|
|
|
Do you have FileAid?
O. |
|
| Back to top |
|
 |
mytags
Active User
Joined: 28 Apr 2008 Posts: 60 Location: US
|
|
|
|
| By using listcatentries in the Copy book list we can find the length of the copy book. |
|
| Back to top |
|
 |
ManjulaRajamurugan
New User
Joined: 28 Apr 2008 Posts: 4 Location: Hyderabad
|
|
|
|
| may i know where to give it? that listcatentries? |
|
| Back to top |
|
 |
ManjulaRajamurugan
New User
Joined: 28 Apr 2008 Posts: 4 Location: Hyderabad
|
|
|
|
| also can we find it using option 3 and then 13? |
|
| Back to top |
|
 |
mytags
Active User
Joined: 28 Apr 2008 Posts: 60 Location: US
|
|
|
|
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 |
|
 |
ManjulaRajamurugan
New User
Joined: 28 Apr 2008 Posts: 4 Location: Hyderabad
|
|
|
|
| ok thanks |
|
| Back to top |
|
 |
mytags
Active User
Joined: 28 Apr 2008 Posts: 60 Location: US
|
|
|
|
'Welcome'
Manjula
With regards
Hari |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1050 Location: germany
|
|
|
|
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 |
|
 |
acevedo
Active User
Joined: 11 May 2005 Posts: 256 Location: Spain
|
|
|
|
what about ?
| Quote: |
| DISPLAY LENGTH OF yourcopybook |
|
|
| Back to top |
|
 |
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1470
|
|
|
|
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 |
|
 |
acevedo
Active User
Joined: 11 May 2005 Posts: 256 Location: Spain
|
|
|
|
| our standards says: if any, only one 01 level por copybook. |
|
| Back to top |
|
 |
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1470
|
|
|
|
| The PS was for Manjula. |
|
| Back to top |
|
 |
acevedo
Active User
Joined: 11 May 2005 Posts: 256 Location: Spain
|
|
|
|
| My reply was not the result of thinking that PS was for me, it was just a comment. |
|
| Back to top |
|
 |
Bill O'Boyle
Active User
Joined: 14 Jan 2008 Posts: 210 Location: Orlando, FL, USA
|
|
|
|
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 |
|
 |
|
|