Passing alphanumeric value from COBOL to JCL?



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

Passing alphanumeric value from COBOL to JCL?

Postby nbdkygs » Thu Jul 10, 2008 8:10 pm

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
nbdkygs
 
Posts: 8
Joined: Mon Jun 23, 2008 12:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Passing alphanumeric value from COBOL to JCL?

Postby MrSpock » Thu Jul 10, 2008 8:57 pm

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.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Passing alphanumeric value from COBOL to JCL?

Postby jayind » Sat Jul 12, 2008 5:21 pm

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
jayind
 
Posts: 62
Joined: Wed Apr 23, 2008 1:37 pm
Location: Chennai, India
Has thanked: 0 time
Been thanked: 0 time

Re: Passing alphanumeric value from COBOL to JCL?

Postby nbdkygs » Mon Jul 14, 2008 5:30 pm

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".
nbdkygs
 
Posts: 8
Joined: Mon Jun 23, 2008 12:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Passing alphanumeric value from COBOL to JCL?

Postby dick scherrer » Mon Jul 14, 2008 11:29 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Passing alphanumeric value from COBOL to JCL?

Postby nbdkygs » Tue Jul 15, 2008 9:16 am

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.
nbdkygs
 
Posts: 8
Joined: Mon Jun 23, 2008 12:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Passing alphanumeric value from COBOL to JCL?

Postby dick scherrer » Tue Jul 15, 2008 9:31 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Passing alphanumeric value from COBOL to JCL?

Postby Bill Dennis » Wed Jul 16, 2008 2:31 am

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.
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post