IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

IDCAMS listcat service using cobol


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sandeep.kumar

New User


Joined: 16 Aug 2021
Posts: 11
Location: India

PostPosted: Fri Oct 08, 2021 9:28 pm
Reply with quote

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
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Sat Oct 09, 2021 6:15 pm
Reply with quote

What is it that you want to know ? Please use a code tags when showing us the code.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Convert Service Unit to CPU Seconds All Other Mainframe Topics 1
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 0
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts Compile Sp Cobol base COBOL Programming 1
Search our Forums:

Back to Top