REXX tool to calculate total byte length of record layout



IBM's Command List programming language & Restructured Extended Executor

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

Postby NicC » Thu Nov 11, 2010 5:04 pm

And you also get OCCURS DEPENDING ON or REFER in PL/1. That really makes it difficult as the length is never known until the record is moved into storage.

I have a rexx exec that does this sort of thing for PL/1 structures - it is nearly 700 lines long including comments and error handling and it specifically disallows structures that use REFER or controlled storage specified as *.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

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

 

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

Postby prino » Thu Nov 11, 2010 6:55 pm

NicC wrote:And you also get OCCURS DEPENDING ON or REFER in PL/1. That really makes it difficult as the length is never known until the record is moved into storage.

I have a rexx exec that does this sort of thing for PL/1 structures - it is nearly 700 lines long including comments and error handling and it specifically disallows structures that use REFER or controlled storage specified as *.


Do you handle UNION's, and do you actually use the PL/I mapping rules?

My PL/I structure parser code is around 1,100 lines, doesn't handle UNION's, doesn't handle the more exotic stuff (like AREA's and ENTRY variables) and even UNAL BIT's are silently converted to ALIGNED. It also completely ignores the official PL/I mapping rules and simply assumes the structure as a whole is UNAL. You should be able to see it on 'that' system, member RAP00110.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

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

Postby NicC » Thu Nov 11, 2010 7:08 pm

Robert

It was based on PL/1 V2 which, I think, does not have UNION. It also does not handle LIKE plus lots of other stuff. Cannot remember what it does with UN/ALIGNED. It was more an exercise to fill time than to be a useful tool!
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

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

Postby Akatsukami » Thu Nov 11, 2010 11:24 pm

Pedro wrote: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.

Indeed, we have a tool (that I did not write; therefore I will not post any code, panels, etc. here) that tailors a skeleton consisting of a very simple PL/I program (basically just PROC, %INCLUDE, and END statements) to use the copybook in question and compiles it, thus getting the exact scalar and aggregate lengths that will actually be used in "real life" (or if it doesn't, it becomes Peter Elderon's problem, not mine :D ). I strongly urge the TS to consider a similar solution.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Previous

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post