Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic open in cobol program

Status
Not open for further replies.

ejroger

Technical User
Nov 15, 2002
1
FR
Hi.
I need a program that would process (read and scan) numerous members of a PDS.
HOW SHOULD I DO IT WITHIN A COBOL PROGRAM ?

-> I was thinking of extracting the member list with a rexx, parse it to a program, and process every members.

Thus, HOW WOULD I OPEN those MEMBERs DYNAMICALLY IN COBOL ?

Can I address TSO with the command TSO ALLOC FI(FICIN) DA('"DsnIn"') SHR" ? And HOW !


Thanks for your help.
Regards
JFR

 
(You can do this with REXX but using the JCL below is better, faster, and more maintainable for a large PDS)
I used this JCL to remove all JOBLIB card and replace them with a standard include joblib statement.)

//BACKUP EXEC PGM=FILEAID, ** BACKUP PDS **
// REGION=4M
//STEPLIB DD DSN=SYS1.FILEAID.LINKLIB,
// DISP=(SHR,KEEP,KEEP)
//DD01 DD DSN=PROD.PDS.EXECLIB, <========= PDS TO FIX
// DISP=(SHR,KEEP,KEEP)
//DD01O DD DSN=YOURID.PDS.OLD, (BACKUP) OLD PDS
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(200,100,5000),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSIN DD *
$$DD01 COPYMEM MEMBERS=ALL
/*
//PUNCH EXEC PGM=IEBPTPCH ** UNLOAD PDS **
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=YOURID.PDS.OLD, OLD PDS
// DISP=(SHR,KEEP,KEEP)
//SYSUT2 DD DSN=YOURID.FLAT.PUNCH, UNLOADED PDS
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(200,100),RLSE),
// DCB=(RECFM=FBM,LRECL=81,BLKSIZE=0)
//* ... YOU'LL NEED RECFM=FBM,LRECL=81 ...
//SYSIN DD *
PUNCH TYPORG=PO,MAXFLDS=999
RECORD FIELD=(80,1)
LABELS DATA=NO
/*
//*
//CONVERT EXEC PGM=FILEAID, **CONVERT FILE **
// REGION=4M
//STEPLIB DD DSN=SYS1.FILEAID.LINKLIB,
// DISP=(SHR,KEEP,KEEP)
//DD01 DD DSN=YOURID.FLAT.PUNCH, UNLOADED PDS
// DISP=(SHR,KEEP,KEEP)
//DD01O DD DSN=YOURID.FLAT.CONVERT, CONVERTED PDS
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(200,100),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSIN DD *
*** THIS REPLACES A STANDARD PUNCH CARD TO A IEBUPDTE CARD
$$DD01 USER IF=(2,EQ,C'MEMBER NAME '), IF MEMBER
MOVE=(1,C'./ ADD NAME='), 21 BYTES
MOVE=(+0,C' '), 30 SPACES
MOVE=(+0,C' '), 29 SPACES
MOVE=(22,8,15),WRITE=DD01O, MOVE NAME
IF=(2,NE,C'MEMBER NAME '), IF MEMBER
MOVE=(1,80,2), 80 BYTES
WRITE=DD01O WRITE REC
/*
//* (This is you COBOL fix program)
//FIXJCL EXEC PGM=FIXPGM1, **SPLIT JOBLIB **
// REGION=4M
//STEPLIB DD DSN=YOURID.LOADLIB,
// DISP=(SHR,KEEP,KEEP)
//SYSUT1 DD DSN=YOURID.FLAT.CONVERT, CONVERTED PDS
// DISP=(SHR,KEEP,KEEP) (80 BYTE FILE)
//SYSUT2 DD DSN=YOURID.FLAT.FIXED, FIXED JCL
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(200,100),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSLIST DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//*
//LOADNEW EXEC PGM=IEBUPDTE,PARM=NEW ** LOAD PDS **
//SYSUT2 DD DSN=YOURID.PDS.NEW, NEW PDS
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(200,100,5000),RLSE)
//SYSPRINT DD DUMMY
//SYSIN DD DSN=YOURID.FLAT.FIXED, FIXED JCL
// DISP=(SHR,KEEP,KEEP)
//*
//COMPARE EXEC PGM=ISRSUPC, ** COMPARE PDS **
// PARM=(DELTAL,LINECMP,
// ' SEQ',
// '')
//NEWDD DD DSN=YOURID.PDS.NEW, NEW PDS
// DISP=(SHR,KEEP,KEEP)
//OLDDD DD DSN=YOURID.PDS.OLD, OLD PDS
// DISP=(SHR,KEEP,KEEP)
//OUTDD DD SYSOUT=*
//*
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top