REXX tool to calculate total byte length of record layout



IBM's Command List programming language & Restructured Extended Executor

REXX tool to calculate total byte length of record layout

Postby manjujacob13 » Thu Mar 04, 2010 10:24 am

Hi,

I am new to Rexx. I have a requirement to create REXX tool to calculate the total record legth of selected portion of layout. Can anyone please help me to do this.


Thanks,
Manju jacob
manjujacob13
 
Posts: 7
Joined: Fri Feb 26, 2010 9:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: REXX tool to calculate total byte length of record layout

Postby dick scherrer » Thu Mar 04, 2010 10:50 am

Hello,

Can anyone please help me to do this.
Not from what you have posted. You need to much more clearly describe what you want to accomplish. . .

Show an example of what you "have" and what you want from what you have.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: REXX tool to calculate total byte length of record layout

Postby manjujacob13 » Thu Mar 04, 2010 12:36 pm

Hi Dick,

For eg: Following is record layout in COBOL

01 WS-EMPLOYE
05 WS-EMP-ID PIC X(8)
05 WS-NAME PIC X(15)
05 WS-DEPT PIC X(10)
05 WS-SALARY PIC S9(09) USAGE COMP
05 WS-ADDRESS
10 WS-STREET PIC X(10)
10 WS-DOORNO PIC 9(05)
10 WS-POST PIC X(10)

Here, I wanted to calcualte the total length (in byte) from WS-EMP-ID till WS-DOORNO without calculating manually.
i think, now the requirement is clear.

Thanks,
Manju Jacob
manjujacob13
 
Posts: 7
Joined: Fri Feb 26, 2010 9:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: REXX tool to calculate total byte length of record layout

Postby expat » Thu Mar 04, 2010 1:04 pm

Have you also considered what if the COBOL source has REDEFINES in it
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: REXX tool to calculate total byte length of record layout

Postby manjujacob13 » Thu Mar 04, 2010 1:51 pm

Yes...we need to consider redefine & occurs clause also.

Thanks,
Manju jacob
manjujacob13
 
Posts: 7
Joined: Fri Feb 26, 2010 9:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: REXX tool to calculate total byte length of record layout

Postby dick scherrer » Fri Mar 05, 2010 12:50 am

Hello,

I am new to Rexx.
Here, I wanted to calcualte the total length (in byte) from WS-EMP-ID till WS-DOORNO without calculating manually.
i think, now the requirement is clear.


This is not really a task for someone new to rexx. It is actually not a task for most people who are rexx experts unless they are willing to re-create a major portion of the COBOL compiler. . .

If this is something you want running anytime soon, suggest you consider using the output from a compile and manipulating the lengths provided by the compiler to produce the result you want. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: REXX tool to calculate total byte length of record layout

Postby expat » Fri Mar 05, 2010 1:52 pm

And the logic of the REXX would also have to take into consideration the different coding methods for defining the same thing

NN  NAME1     COMP-3   PIC 9(3)
NN  NAME2     COMP-3   PIC 999      
NN  NAME3              PIC 9(3)  USAGE COMP-3
NN  NAME3              PIC 999   USAGE COMP-3
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: REXX tool to calculate total byte length of record layout

Postby Pedro » Thu Mar 11, 2010 10:39 am

I am not a Cobol user, but some language compilers have some information in their listings. I suggest you have a small program that uses that record layout and then examine the compiler listing. You might also read about the debugging options of the compiler which might give you more information.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: REXX tool to calculate total byte length of record layout

Postby stephenjacob1984 » Thu Nov 11, 2010 2:31 am

Manju Jacob,
Iam also facing the same isssue.Can you figure out my doubt regarding the same, if you have a willingness to help on the same topic, REXX tool to calculate total byte length of record layout.I have mailed detail to Your inbox, but its pending i think... Please help.
Regards,
Stephen Jacob.
stephenjacob1984
 
Posts: 1
Joined: Thu Nov 11, 2010 1:55 am
Location: uk
Has thanked: 0 time
Been thanked: 0 time

Re: REXX tool to calculate total byte length of record layout

Postby stevexff » Thu Nov 11, 2010 12:18 pm

Assuming that you want to be able to pass a copybook and have the 'tool' work out the lengths, then expat's solution is the one to go with. If you want to get even more clever, use the ADATA output from the compiler - this is specifically designed to be used by debugging and post-processing tools and saves you having to parse the listing file.
Steve
stevexff
 
Posts: 56
Joined: Wed Nov 10, 2010 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post