DD name - jcl to be readed in Cobol program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

DD name - jcl to be readed in Cobol program

Postby iaccbond » Wed Jan 20, 2016 12:40 pm

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]
iaccbond
 
Posts: 10
Joined: Wed Dec 30, 2015 12:56 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Wed Jan 20, 2016 12:47 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby iaccbond » Wed Jan 20, 2016 3:18 pm

i want to read DDNAME in jcl.
just ddname i have to perform operation in pgm based on DD name. only.
iaccbond
 
Posts: 10
Joined: Wed Dec 30, 2015 12:56 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Wed Jan 20, 2016 5:25 pm

And what if it is not there? How do you know which DD you want to know is there?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby iaccbond » Wed Jan 20, 2016 6:13 pm

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.
iaccbond
 
Posts: 10
Joined: Wed Dec 30, 2015 12:56 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Wed Jan 20, 2016 6:16 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby iaccbond » Wed Jan 20, 2016 6:30 pm

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
iaccbond
 
Posts: 10
Joined: Wed Dec 30, 2015 12:56 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Wed Jan 20, 2016 6:31 pm

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).
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post