Page 1 of 1

Passing alphanumeric value from COBOL to JCL?

PostPosted: Thu Jul 10, 2008 8:10 pm
by nbdkygs
Is there any way to pass the alphanumerica values to JCL?

suppose.... we have a JCL running the program "Prog1"....
Prog1 contains alphanumeric PIC defined...... assume PIC X(10) VALUE IS "ABCD".


Now I want to use the "ABCD" in JCL... Is there any way to do this?

Please help me...

Thanks,
Sesh

Re: Passing alphanumeric value from COBOL to JCL?

PostPosted: Thu Jul 10, 2008 8:57 pm
by MrSpock
Nope.

The description of the RETURN-CODE register from the Enterprise COBOL manual:

4.2.4 Passing return-code information.

and, more importantly, the description of the COND parameter from the JCL Reference Manual:

16.5 COND Parameter

and

17.1.4.5 Relational-Expression Keywords.

Code specifies a number that the system compares to the return codes from all previous steps in the job or from specific steps. Code is a decimal number from 0 through 4095.
Note: Specifying a decimal number greater than 4095 could result in invalid return code testing or invalid return codes in messages.

Re: Passing alphanumeric value from COBOL to JCL?

PostPosted: Sat Jul 12, 2008 5:21 pm
by jayind
Hi nbdkygs,

Give us an example how do you want to use the returned value 'ABCD' in JCL? Probably someone can suggest you an alternative..

Regards,
Jayind

Re: Passing alphanumeric value from COBOL to JCL?

PostPosted: Mon Jul 14, 2008 5:30 pm
by nbdkygs
If we consider "ABC.DEF.GHI" is a DSN which is sent from COBOL to JCL.
I want to catalog a PS with this naming convention "ABC.DEF.GHI".

Re: Passing alphanumeric value from COBOL to JCL?

PostPosted: Mon Jul 14, 2008 11:29 pm
by dick scherrer
Hello,

You need to do a better job of explaining how this dsn was gotten into the cobol code to be "sent" to jcl.

If you explain the requirement (rather than how you have chosen to accomlish the requirement), we may be able to offer suggestions.

Basically, cobol does not "have" dsns to "give" to jcl. As was replied to your original post, cobol does not "pass" alpha values to jcl. COBOL (and other programming languages) may set a condition code to be checked in jcl, but not pass other values.

Re: Passing alphanumeric value from COBOL to JCL?

PostPosted: Tue Jul 15, 2008 9:16 am
by nbdkygs
Hi,

I have a Dataset "nbdkygs.dslist.list1". Its DSORG is PS, LRECL=80, RECFM= FB This contains a list of dataset names like:

note: consider each dataset name as a record in the file "nbdkygs.dslist.list1".

ABC.DEF.GHI
HGT.KJU.KLIJ
BJIE.KONH.GHJSU
....and soon
...
..
.

Now, my requirement is to catalog all the datasets listed in this file. Among these datasets, few are PS, few are VSAM and few are GDG bases.

Re: Passing alphanumeric value from COBOL to JCL?

PostPosted: Tue Jul 15, 2008 9:31 am
by dick scherrer
Hello,

In the file with the dataset names, you also need to include the information needed to catalog the dataset.

You could then read this file of dsns and associated info and generate the proper utility jcl and control statements to do what you need.

I suspect there is more to your requirement (even if you are not aware of it yet) than merely cataloging a bunch of datasets.

For example, vsam datasets are not merely cataloged. Partitioned datasets need to have directory blocks defined. All dasd datasets need lrecl and space defined. And on, and on. . .

Where did this requirement originate? If you explain just what needs to be accomplished, someone may have suggestions. This would include how these datasets would be used.

Re: Passing alphanumeric value from COBOL to JCL?

PostPosted: Wed Jul 16, 2008 2:31 am
by Bill Dennis
If you can gather the information required, I would suggest writing out a jobstream as you read the file and create JCL to create/catalog each file and submit as a separate job to INTRDR.