View previous topic :: View next topic
|
Author |
Message |
Prasun De
New User
Joined: 17 Jan 2008 Posts: 28 Location: Kolkata, INDIA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If it is working apart from the 133 constraint, have you checked why that is happening and how to fix it? |
|
Back to top |
|
|
Prasun De
New User
Joined: 17 Jan 2008 Posts: 28 Location: Kolkata, INDIA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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" |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If AMBLIST LISTIDR gives it to you, why mess with other stuff? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Dumb question: what do you mean by 'package number'? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
For SUPERC you can use the LONGLN parameter, however, it will only show the fields upto 176.
And possibly use SORT. |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
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 |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
I'm in agreement with Garry and that's why I believe that a SORT search (SS) should suffice for this. |
|
Back to top |
|
|
Prasun De
New User
Joined: 17 Jan 2008 Posts: 28 Location: Kolkata, INDIA
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Thanks for coming back with what-worked-for-you! |
|
Back to top |
|
|
|