View previous topic :: View next topic
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Do you have FileAid?
O. |
|
Back to top |
|
|
mytags
New User
Joined: 28 Apr 2008 Posts: 63 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
New User
Joined: 28 Apr 2008 Posts: 63 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
New User
Joined: 28 Apr 2008 Posts: 63 Location: US
|
|
|
|
'Welcome'
Manjula
With regards
Hari |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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: 344 Location: Spain
|
|
|
|
what about ?
Quote: |
DISPLAY LENGTH OF yourcopybook |
|
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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: 344 Location: Spain
|
|
|
|
our standards says: if any, only one 01 level por copybook. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
The PS was for Manjula. |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 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
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, 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 |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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....
Bill |
|
Back to top |
|
|
sudhaaa
New User
Joined: 24 Mar 2005 Posts: 51
|
|
|
|
If you have Fileaid, use option 3.8
Thanks,
Sudhaaa |
|
Back to top |
|
|
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
Option 8 (XREF) will give you the length !! |
|
Back to top |
|
|
Pankaj Gupta Currently Banned New User
Joined: 07 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
The compiler it is not compiling "LENGTH OF". |
And it should not/will not. . . .
That suggestion was for using fileaid, not compiling a program. |
|
Back to top |
|
|
Pankaj Gupta Currently Banned New User
Joined: 07 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
acevedo wrote: |
what about ?
Quote: |
DISPLAY LENGTH OF yourcopybook |
|
Mr dick, I am sure this is meant to be the COBOL |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Mr dick, I am sure this is meant to be the COBOL |
Why so sure? Your certainty is misplaced if you mean the cobol compiler.
There is no "display length of" in the IBM mainframe cobol language.
The suggestion was for displaying the length using fileaid. |
|
Back to top |
|
|
Pankaj Gupta Currently Banned New User
Joined: 07 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
I am really not being so sure. In COBOL we are having the DISPLAY verb and we are also having "LENGTH OF".
Why is then DISPLAY LENGTH OF VARIABLE not being COBOL?
Is DISPLAY also being a command of the FILEAID? If this is being so then I have never been seeing it. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
I am back to this question and back to my answer.
The handy tool of Mark H. is just perfect for that.
On top of that the poster seems to want to calculate the length outside a program, just online in ISPF.
But maybe noone does the effort to go inside the link and to open the first thread of Mark H.
Ohh these days ...
Cheers
Pierre |
|
Back to top |
|
|
|