Steff,

I've tried to use sort to help.

// EXPORT SYMLIST=*
// SET INPMOD=oldmd
// SET OUTMOD=newmod
// SET INPLIB=myold.lib
// SET OUTLIB=mynew.lib
//*-------------------------------------------------------------------*
//*                                                                   *
//*-------------------------------------------------------------------*
//ST010  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *,SYMBOLS=(JCLONLY,SYMBLOG)
 DELETE &SYSUID..AMBLIST2
 IF MAXCC=8 THEN SET MAXCC=0
/*
//*-------------------------------------------------------------------*
//*                                                                   *
//*-------------------------------------------------------------------*
//ST020  EXEC PGM=AMBLIST
//SYSPRINT DD DSN=&SYSUID..AMBLIST2,DISP=(,CATLG),
// SPACE=(TRK,(5,5),RLSE)
//LOADLIB  DD DISP=SHR,DSN=&INPLIB
//SYSIN    DD *,SYMBOLS=(JCLONLY,SYMBLOG)
 LISTIDR DDN=LOADLIB,MEMBER=&INPMOD
/*
//*-------------------------------------------------------------------*
//*                                                                   *
//*-------------------------------------------------------------------*
//ST030  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *,SYMBOLS=(JCLONLY,SYMBLOG)
 DELETE &SYSUID..AMBLIST2.CMD
 IF MAXCC=8 THEN SET MAXCC=0
/*
//*-------------------------------------------------------------------*
//*                                                                   *
//*-------------------------------------------------------------------*
//ST040  EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN  DD DSN=&SYSUID..AMBLIST2,DISP=SHR
//SORTOUT DD DSN=&SYSUID..AMBLIST2.CMD,DISP=(,CATLG),
// SPACE=(TRK,(5,5),RLSE),DCB=(LRECL=80,RECFM=FB,DSORG=PS)
//SYSIN    DD *,SYMBOLS=(JCLONLY,SYMBLOG)
 SORT FIELDS=COPY
 OUTFIL FNAMES=SORTOUT,REMOVECC,
  INCLUDE=(2,10,CH,EQ,C'CSECT:    ',AND,
           12,8,CH,NE,C'&OUTMOD'),
 OUTREC=(C' REPLACE ',12,8,80:X),
  TRAILER1=(' INCLUDE SYSLIB(&INPMOD)',/,
   ' NAME &OUTMOD(R)')
/*
//*-------------------------------------------------------------------*
//*                                                                   *
//*-------------------------------------------------------------------*
//ST050    EXEC PGM=HEWL,
//         PARM='LET,XREF,MAP,LIST,NCAL'
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DSN=&&SYSUT1,SPACE=(1024,(120,120),,,ROUND),
// DCB=BUFNO=1
//*YSLIN   DD DISP=SHR,DSN=J48017.OSET.LOAD(IRXINIT)
//SYSLIB   DD  DISP=SHR,DSN=&INPLIB
//SYSLMOD  DD  DISP=SHR,DSN=&OUTLIB(&OUTMOD)
//SYSLIN   DD  DISP=SHR,DSN=&SYSUID..AMBLIST2.CMD
//*-------------------------------------------------------------------*
//*                                                                   *
//*-------------------------------------------------------------------*
//ST060  EXEC PGM=AMBLIST
//SYSPRINT DD SYSOUT=*
//LOADLIB  DD DISP=SHR,DSN=&OUTLIB
//SYSIN    DD *,SYMBOLS=(JCLONLY,SYMBLOG)
 LISTIDR DDN=LOADLIB,MEMBER=&OUTMOD
 LISTLOAD DDN=LOADLIB,MEMBER=&OUTMOD
/*

It seems working (double check please).
I used "no-temp" dataset to better help in understanding the process.
It would be not so hard the case you need to isolate multiple modules into
one single output module.

Best regards.

Max



<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Mail
priva di virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Il giorno lun 4 gen 2021 alle ore 11:46 Steff Gladstone <
[email protected]> ha scritto:

> Greetings,
>
> Can anyone suggest a method of isolating or extracting a CSECT
> (statically-linked called program) from a load module?  The only (clumsy)
> method I can think of is using (within the linkage editor or binder) a
> REPLACE statement ahead of an INCLUDE statement and specifying in the
> REPLACE all of the other CSECTS in the load module.  For example, if the
> load module is called LOADMOD1 and contains CSECTS  A,B,C,D,E,F,G,H and I
> want to isolate CSECT F, I would code:
>
>               REPLACE A,B,C,D,E,G,H
>               INCLUDE SYSLIB(LOADMOD1)
>               NAME F(R)
>
> Obviously this is unwieldy for a load module with lots of CSECTs.
>
> Does anyone have a more elegant way of doing this?
>
> Thanks,
> Steff
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to