Select And DD Statments



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Select And DD Statments

Postby nameexists » Tue Nov 13, 2012 6:04 pm

Hi,

In my cobol program I have 2 select statements in the FILE-CONTROL of Environment Division. In first compile and link JCL I have 3 DD statements and in my second run JCL I have 4 DD statements, is this right? should I not have 4 DD statements in each. My first JCL is submitting ok, but my secound JCL is giving me a JCL ERROR CN(INTERNAL) . I was wondering has this got something to do with it.

Thanks
nameexists
 
Posts: 9
Joined: Mon Nov 12, 2012 5:41 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Select And DD Statments

Postby Robert Sample » Tue Nov 13, 2012 6:18 pm

Compile and link JCL has no relationship to the SELECT statements in your program. Compile JCL will vary if -- AND ONLY IF -- you have COPY statements in your program and you need to include the SYSLIB DD statement to point to your copy book library (or libraries). Linkage editor / binder JCL will vary if you call subroutines with a static call and need to link them into your program load module.

Execution JCL will typically have a STEPLIB DD statement to point to the load library you compiled your program into, a SYSOUT DD for DISPLAY statements, and then 0, 1, or 2 (or more) DD statements per SELECT statement in your program. The actual number of necessary DD statements will depend upon how your program is coded and what type of files your SELECT statements are for.

These users thanked the author Robert Sample for the post:
nameexists (Tue Nov 13, 2012 6:30 pm)
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

Re: Select And DD Statments

Postby NicC » Wed Nov 14, 2012 2:52 am

just to clarify, I believe, 1 DD statement per SELECT.Y
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Select And DD Statments

Postby dick scherrer » Wed Nov 14, 2012 3:44 am

Hi Nic,

Is the .Y a typo?

There can be more than one dd statement for a SELECT.

d
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: Select And DD Statments

Postby Robert Sample » Wed Nov 14, 2012 4:58 am

A VSAM KSDS with alternate index(es) defined that has the alternate index(es) defined to COBOL program in the SELECT ASSIGN clause will have MORE than 1 DD statement per SELECT. The base KSDS will have one DD statement, and each alternate index path will have a DD statement as well. If the base cluster ASSIGN is to a DD name of less than 8 characters, the alternate index path(s) will have the DD name appended with 1, 2, ..., 10, 11 .... If the base cluster ASSIGN is to a DD name of 8 characters, the last character becomes 1, then 2, through 9 after which the last 2 characters become 10, 11, etc.
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

Re: Select And DD Statments

Postby BillyBoyo » Wed Nov 14, 2012 5:49 am

Also simple concatenation will have more than one DD statement per SELECT. There will only be one named DD per select, however, for a concatenation.

A VSAM ESDS with an alternate index will also have more than one, named, DD statements per SELECT.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post