sandeep.kumar
New User
Joined: 16 Aug 2021 Posts: 11 Location: India
|
|
|
|
Kevin wrote:
I'm not sure why you're insisting on doing this within a jobstream when that's not possible.
Here's an option:
Code:
//STEP0001 EXEC PGM=CHECKDSN,PARM='&CLIENT..CHECKDSN.IDCAMS'
//STEPLIB DD DISP=SHR,DSN=&SYSUID..COBOL.LOAD
//SYSIN DD UNIT=VIO,DISP=(,DELETE),RECFM=FB,LRECL=80
//SYSPRINT DD SYSOUT=*
//*
//STEP0002 EXEC PGM=IKJEFT01,PARM='%CHECKDSN &CLIENT..CHECKDSN.IDCAMS'
//SYSPROC DD DISP=SHR,DSN=&SYSUID..CLIST
//SYSTSIN DD DUMMY
//SYSTSPRT DD SYSOUT=*
//*
//STEP0003 EXEC PGM=IKJEFT01,PARM='%CHECKDSN &CLIENT..CHECKDSN.IDCAMS'
//SYSPROC DD DISP=SHR,DSN=&SYSUID..REXX
//SYSTSIN DD DUMMY
//SYSTSPRT DD SYSOUT=*
//*
where:
Code:
COBOL:
IDENTIFICATION DIVISION.
PROGRAM-ID. CHECKDSN.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SYSIN-FILE ASSIGN TO UT-S-SYSIN
ORGANIZATION IS SEQUENTIAL
ACCESS IS SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD SYSIN-FILE
LABEL RECORD STANDARD
BLOCK 0 RECORDS
RECORDING MODE F
RECORD CONTAINS 80 CHARACTERS.
01 SYSIN-RECORD PIC X(80).
WORKING-STORAGE SECTION.
LINKAGE SECTION.
01 PARM.
03 PARM-LENGTH PIC S9(04) COMP SYNC.
03 THE-PARM.
05 THE-DATASET-NAME PIC X(44).
PROCEDURE DIVISION USING PARM.
INSPECT THE-PARM
REPLACING ALL LOW-VALUES BY SPACES.
DISPLAY THE-PARM.
OPEN OUTPUT SYSIN-FILE.
MOVE SPACES TO SYSIN-RECORD.
STRING ' LISTCAT ENT('
DELIMITED BY SIZE
THE-DATASET-NAME
DELIMITED BY SPACES
') ALL'
DELIMITED BY SIZE
INTO SYSIN-RECORD.
WRITE SYSIN-RECORD.
CLOSE SYSIN-FILE.
CALL 'IDCAMS'.
STOP RUN.
Code:
CLIST:
PROC 1 THEDSN
LISTCAT ENT('&THEDSN') ALL
EXIT CODE(&LASTCC)
Code:
REXX:
/* REXX */
"LISTCAT ENT('"ARG(1)"') ALL"
EXIT RC
It’s always return 0000 in Cobol. I have executed cobol program with catalog flat file and uncatalog flat file(ps) but in both cases CALL ‘IDCAM’ returns 000000. Can you please help me out? how to get correct result?
_________________
sandeep kumar |
|