Page 1 of 1

DD name - jcl to be readed in Cobol program

PostPosted: Wed Jan 20, 2016 12:40 pm
by iaccbond
hi guys,
I want to read DD name in cobol program
-----------------------------------------------------------jcl step---------------------------
//TABEL1   DD DSN=abcdef.12345.mnopur.UNLO,DISP=SHR
//PARAM    DD DSN=LOP00.INPUT(milogic),DISP=SHR           
//OUTPUTFO DD DSN=abcdef.123445.abdedf..HEAD,       
//            DISP=(NEW,CATLG,DELETE),                     
//            RECFM=FB,LRECL=200,SPACE=(CYL,(100,50),RLSE)
//SYSTSIN  DD DSN=abdef.INPUT.DB2(MIcard01),DISP=SHR     

--------------------------------------------------------------------------------

i am calling cobol program :ficobol, in that program i want to read the value of Tabel1, could anyone guide us.
[coded]

Re: DD name - jcl to be readed in Cobol program

PostPosted: Wed Jan 20, 2016 12:47 pm
by BillyBoyo
It is very unclear what you want to do. Do you want to read the data in that dataset? Do you want to get the dataset-name? Do you want to see if the DDname is present in the JCL? Or something else?

Re: DD name - jcl to be readed in Cobol program

PostPosted: Wed Jan 20, 2016 3:18 pm
by iaccbond
i want to read DDNAME in jcl.
just ddname i have to perform operation in pgm based on DD name. only.

Re: DD name - jcl to be readed in Cobol program

PostPosted: Wed Jan 20, 2016 5:25 pm
by BillyBoyo
And what if it is not there? How do you know which DD you want to know is there?

Re: DD name - jcl to be readed in Cobol program

PostPosted: Wed Jan 20, 2016 6:13 pm
by iaccbond
i want to use dd name or dsn name ; its a requirment, i just want to read dsn name and dd name in the cobol program and if record is match than perform needful operation.

Re: DD name - jcl to be readed in Cobol program

PostPosted: Wed Jan 20, 2016 6:16 pm
by BillyBoyo
OK, it is still not clear what you want. Look at using OPTIONAL on the SELECT statement. Then, on the OPEN, you can tell from the FILE STATUS field (I assume you are already using that) whether the DD is present in the step, or not.

Re: DD name - jcl to be readed in Cobol program

PostPosted: Wed Jan 20, 2016 6:30 pm
by iaccbond
hi Billy,

Thanks for help, it will solve the problem but i have to open each file and check its status,
i am calling pgm with 100 parameters, i have to perform operation on only one parameter which match with the DD name or Dsn name, if dd name match i have to do the needful operation. Same card is just for 100 jobs

Re: DD name - jcl to be readed in Cobol program

PostPosted: Wed Jan 20, 2016 6:31 pm
by Robert Sample
The COBOL SELECT statement has the ASSIGN clause. The DDNAME is part of the ASSIGN clause -- period. So you already know the DDNAME. It is not at all clear from your posts what it is you want to do. If you are wanting the data set name for the DDNAME, you can get it by going through MVS control blocks. However, that is not a task for a new COBOL programmer (there are examples on this forum of how to retrieve it).