IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem getting package number from load module from REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Prasun De

New User


Joined: 17 Jan 2008
Posts: 28
Location: Kolkata, INDIA

PostPosted: Thu May 24, 2012 5:16 pm
Reply with quote

I was building a tool to read a load library and find out the package number for each cobol program load in that library.

Say package number starts with 'XXXX00'.

So I was doing SRCHFOR with 'XXXX00' in the load library.
From the result, I was picking up the package number using REXX logic.

This is working fine when package number is present in the load module between column 1 and 133.

My solution did not work, as ISRSUPC could not return the package number in the output.

Any alternate solution or tweaking the current solution would be helpful.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu May 24, 2012 5:38 pm
Reply with quote

If it is working apart from the 133 constraint, have you checked why that is happening and how to fix it?
Back to top
View user's profile Send private message
Prasun De

New User


Joined: 17 Jan 2008
Posts: 28
Location: Kolkata, INDIA

PostPosted: Thu May 24, 2012 6:01 pm
Reply with quote

Think I need to be more clear,

Say the below is the load module line with the package number

Column :----10-----20-------100-----133+++++++++++++++1000----2000
Data :.........ABCD........ ...........................................................XXXX005555.......

So the package number is 5555

When I do SRCHFOR I get the line in output but till 133 byte. So SRCHFOR output give my REXX the string
'.........ABCD........ ..............................'

So REXX could not find the package number from it.

I'm not getting any idead how can I fix it....

Need your help
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu May 24, 2012 6:09 pm
Reply with quote

you don't get ideas, you think of them.

ISRSUPC also provide the record number (relative or cardinal, i forget which)
if the search string is beyond the printing limits,
open the load module (in your REXX script) access the record and find it in there.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu May 24, 2012 6:32 pm
Reply with quote

You could try invoking AMBLIST from your REXX and then locating the package number in user data in the LISTIDR output. This will give you the userdata (which may not always be package number) for every csect in the load module.

Garry.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu May 24, 2012 7:19 pm
Reply with quote

dbzTHEdinosauer wrote:
you don't get ideas, you think of them.

ISRSUPC also provide the record number (relative or cardinal, i forget which)
if the search string is beyond the printing limits,
open the load module (in your REXX script) access the record and find it in there.

That's probably a bit difficult as load modules are RECFM=U and this format is kind of hard to access with REXX...
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu May 24, 2012 7:37 pm
Reply with quote

prino wrote:
dbzTHEdinosauer wrote:
you don't get ideas, you think of them.

ISRSUPC also provide the record number (relative or cardinal, i forget which)
if the search string is beyond the printing limits,
open the load module (in your REXX script) access the record and find it in there.

That's probably a bit difficult as load modules are RECFM=U and this format is kind of hard to access with REXX...

A slight quibble; RECFM=U data sets can't be read with EXECIO. There are third-party substitutes for it that handle them just fine, and Rexx can work with the resulting records equally well, if not better.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu May 24, 2012 7:38 pm
Reply with quote

prino wrote:
dbzTHEdinosauer wrote:
you don't get ideas, you think of them.

ISRSUPC also provide the record number (relative or cardinal, i forget which)
if the search string is beyond the printing limits,
open the load module (in your REXX script) access the record and find it in there.

That's probably a bit difficult as load modules are RECFM=U and this format is kind of hard to access with REXX...


One reason for using the AMBLIST approach.....
Garry.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu May 24, 2012 7:54 pm
Reply with quote

Though the solution is not what i indicated,
one way would be:
Quote:
To circumvent the problem that EXECIO does not support RECFM U and V[B]S,
you can in a REXX exec:
1) Call the OUTTRAP function to intercept TSO command output.
2) Execute the TSO (actually IDCAMS) PRINT command with the CHAR or HEX
option (depending upon what you want) against the member of the program
library.
3) Process the PRINT output.

Regards,

Michel Castelein
Author of (a.o.) a REXX Programming course
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu May 24, 2012 8:03 pm
Reply with quote

There's another way, XMIT the member and look at the resulting .XMIT dataset, catering for the fact that strings may wrap the 80-byte XMIT LRECL.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 24, 2012 8:14 pm
Reply with quote

Hello,

Quote:
catering for the fact that strings may wrap the 80-byte XMIT LRECL.
Once upon a time, we got around this by building one long "working record" for the entire module and then just searching for the value.

No worries about "wrap" icon_wink.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu May 24, 2012 11:04 pm
Reply with quote

If AMBLIST LISTIDR gives it to you, why mess with other stuff?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu May 24, 2012 11:13 pm
Reply with quote

Bill Woodger wrote:
If AMBLIST LISTIDR gives it to you, why mess with other stuff?


but then he has to learn about AMBLIST
(whoops, i meant request code to deal with AMBLIST)
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Thu May 24, 2012 11:15 pm
Reply with quote

Dumb question: what do you mean by 'package number'?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri May 25, 2012 4:29 pm
Reply with quote

For SUPERC you can use the LONGLN parameter, however, it will only show the fields upto 176.

And possibly use SORT.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Fri May 25, 2012 6:42 pm
Reply with quote

Is "package number" some sort of literal you have coded in your programs? Or is it some Z/OS internal thing having to do with object/load modules?
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Fri May 25, 2012 6:52 pm
Reply with quote

Ed Goodman wrote:
Is "package number" some sort of literal you have coded in your programs? Or is it some Z/OS internal thing having to do with object/load modules?
Yeah, I asked the same question yesterday; so far no response.

The TS might be referring to the DB2 precompile timestamp or package version, both of which can be found in the load modue. Or it might be something else entirely.

Terminology is important.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri May 25, 2012 7:01 pm
Reply with quote

don.leahy wrote:
Ed Goodman wrote:
Is "package number" some sort of literal you have coded in your programs? Or is it some Z/OS internal thing having to do with object/load modules?
Yeah, I asked the same question yesterday; so far no response.

The TS might be referring to the DB2 precompile timestamp or package version, both of which can be found in the load modue. Or it might be something else entirely.

Terminology is important.


It looks like the TS has gone away.... My understanding of "package number" comes from the use of ChangeMan at this shop. This product inserts the change package id in user data in the linkedit of the module. I believe other change managemant products do something similar.

Garry.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon May 28, 2012 5:29 pm
Reply with quote

I'm in agreement with Garry and that's why I believe that a SORT search (SS) should suffice for this.
Back to top
View user's profile Send private message
Prasun De

New User


Joined: 17 Jan 2008
Posts: 28
Location: Kolkata, INDIA

PostPosted: Tue May 29, 2012 4:26 pm
Reply with quote

Thank You everybody for all your valuable feedback and ideas.....

I have tried with IDCAMS PRINT solution first, it worked properly except one scenario...
Whenever a program is running from the concerned loadlibrary, IDCAMS PRINt gives RC=12 and abend...

Then I tried AMBLIST and it worked perfectly fine.
(Though it is taking more time than IDCAMS PRINT) but is acceptable.

Thanks to all again...
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed May 30, 2012 3:54 pm
Reply with quote

Thanks for coming back with what-worked-for-you! icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Load new table with Old unload - DB2 DB2 6
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top