Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem getting package number from load module from REXX
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Problem getting package number from load module from REXX
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu May 24, 2012 5:38 pm    Post subject: Reply to: Problem getting package number from load module fr
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    Post subject:
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    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu May 24, 2012 6:32 pm    Post subject:
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

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Thu May 24, 2012 7:19 pm    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Thu May 24, 2012 7:37 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu May 24, 2012 7:38 pm    Post subject:
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    Post subject:
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

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Thu May 24, 2012 8:03 pm    Post subject:
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

Site Director


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

PostPosted: Thu May 24, 2012 8:14 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu May 24, 2012 11:04 pm    Post subject: Reply to: Problem getting package number from load module fr
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    Post subject: Re: Reply to: Problem getting package number from load modul
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: 641
Location: Whitby, ON, Canada

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

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

Senior Member


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

PostPosted: Fri May 25, 2012 4:29 pm    Post subject:
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    Post subject:
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: 641
Location: Whitby, ON, Canada

PostPosted: Fri May 25, 2012 6:52 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri May 25, 2012 7:01 pm    Post subject:
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

Senior Member


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

PostPosted: Mon May 28, 2012 5:29 pm    Post subject:
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    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us