IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL error Misplaced DD name


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Fri Apr 22, 2022 5:02 pm
Reply with quote

Hi All,

I am trying run a job which has two steps in my second step i am using select condition like select if ENV = ECTO execute the proc from library a and select if ENV NE ECTO then the execute the proc from libraray b. but doing so i am getting error below is my jcl.

Code:
 ****** ***************************** Top of Data ******************************
 000001 //TIMSUBPJ JOB (DCS,058000DCS-058400,2TES-TC3,TESTTEAM),               
 000002 //     '&TIRID',CLASS=A,MSGCLASS=S                                     
 000003 //* DIGVIJAY JCL                                                       
 000004 //  SET TE=&SYSCHAR                                                     
 000005 //  SET TS=&TSTAGEC                                                     
 000006 //  SET CCID='&CCID'                                                   
 000007 //  SET TID='&TIRID'                                                   
 000008 //  SET PKG='&PACKAGE'                                                 
 000009 //*                                                                     
 000010 //**********************************************************************
 000011 //*            THIS JOB IS TO GET THE VALUES FROM REXX                 
 000012 //*            PACKAGE EXECUTE                                         
 000013 //***********************************************************
 000013 //**********************************************************************
 000014 //JOBLIB   DD DISP=SHR,DSN=DB95.DSNEXIT                                 
 000015 //         DD DISP=SHR,DSN=DB95.DSNLOAD                                 
 000016 //         DD DISP=SHR,DSN=ALT0.PA.UTILITY.LOADLIB.NOFTP               
 000017 //         DD DISP=SHR,DSN=ALT0.MAINTAIN.LOADLIB                       
 000018 //PROCLIB  JCLLIB ORDER=ALT0.TICTOC.MAINTAIN.PROCLIB                   
 000019 //*********************************************************************
 000020 //* SYMBOLICS: TE   = TEST ENVIRONMENT                                 
 000021 //*            TS   = TARGET ENDEVOR STAGE                             
 000022 //*            CCID = CCID                                             
 000023 //*            TID  = TIR ID                                           
 000024 //*            PKG  = PACKAGE NAME                                     
 000025 //*********************************************************************
 000026 //*                                                                     
 000027 //PACKEXEC EXEC PGM=IKJEFT1A,DYNAMNBR=1500,REGION=128M,                 
 000028 // PARM='PACKEXEC PRE &&TE &&TS &&CCID &&TID &&PKG'                     
 000029 //*                                                                     
 000030 //STEPLIB  DD DSN=DB95.DSNEXIT,DISP=SHR                                 
 000031 //         DD DSN=DB95.DSNLOAD,DISP=SHR                                 
 000032 //SYSEXEC  DD DSN=ALT0.MAINTAIN.CLIST,DISP=SHR                         
 000033 //SUMMARY  DD SYSOUT=*                                                 
 000034 //DETAIL   DD SYSOUT=*                                                 
 000035 //NDVRRPT  DD SYSOUT=*                                                 
 000036 //SYSTSPRT DD SYSOUT=*                                                 
 000037 //SYSTSIN  DD DUMMY                                                     
 000038 //PROJNAME DD *                                                         
 000039 &PROJNAME                                                               
 000040 /*                                                                     
 000041 //*                                                                     
 000042 //**********************************************************************
 000045 //**********************************************************************
 000046 //IF01 IF (PACKEXEC.RC = 0 OR PACKEXEC.RC = 4) THEN                     
 000047 )SEL &ENV ¬= ECT0                                                       
 000048 //PROCLIB  JCLLIB  ORDER=(ALT0.TICTOC.MAINTAIN.PROCLIB)                 
 000049 //*JOBLIB   DD DISP=SHR,DSN=ALT0.MAINTAIN.LOADLIB                       
 000050 // SET PARM=&PARM                                                       
 000051 // SET SYSENV=&ENV                                                     
 000052 // SET S=&SYSCHAR                                                       
 000053 // SET CP=&CDP                                                         
 000054 // SET SYSUID=&&SYSUID                                                 
 000055 // SET TIR=&TIRID                                                       
 000056 // SET NWCPYFLG=&NWCPYFLG                                               
 000057 //*                                                                     
 000058 //NTP0P100  EXEC NTP0P100                                               
 000059 )ENDSEL                                                                 
 000060 )SEL &ENV = ECT0                                                       
 000061 //PROCLIB  JCLLIB  ORDER=(ALT0.MAINTAIN.PROCLIB)           
 000062 //*JOBLIB   DD DISP=SHR,DSN=ALT0.MAINTAIN.LOADLIB         
 000063 // SET PARM=&PARM                                         
 000064 // SET SYSENV=&ENV                                         
 000065 // SET S=&SYSCHAR                                         
 000066 // SET CP=&CDP                                             
 000067 // SET SYSUID=&&SYSUID                                     
 000068 // SET TIR=&TIRID                                         
 000069 // SET NWCPYFLG=&NWCPYFLG                                 
 000070 //*                                                       
 000071 //NTP0P100  EXEC NTP0P100                                 
 000072 )ENDSEL                                                   
 000073 //ENDIF01 ENDIF                                           
 000074 //                                                         
**********



Code:
EROR :

 TIMSUBPJ (SYSMSG) ------------- LINE         1 OF         4-- COL   1  80 -----
 COMMAND ===>                                                  SCROLL ===> PAGE
 FILE>   DCSQBTCH.TIMSUBPJ.JOB08477.D0000004.JESYSMSG,2022.112,06:59:58   <FILE
 STMT NO. MESSAGE                                                               
       23 IEFC019I MISPLACED DD STATEMENT                                       
       31 IEFC001I PROCEDURE NTP0P100 WAS EXPANDED USING PRIVATE LIBRARY ALT0.TI
 ******************************** END OF DATA
**********************************


[code]



this jcl was existing jcl and used to be called from rexx but now i wanted to run this jcl by submiting it manually and i am getting this error. I have commented out JOB lib part though it was there before in second step but my requirement is in selection criteria as i mentioned before and as you can see in JCL if ENV is ECTP the proc NTP0100 should execute from diffrent libray and when ENV NE ectp it should be executing from diffrent library.

Anyone any help here would be great.Let me know if needed more explanation.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Fri Apr 22, 2022 5:30 pm
Reply with quote

Your example is not a ready-to-use JCL member.

This is so called "skeleton" prepared to be used by FTS (File Tailoring Services) in order to prepare the actual JCL output, which in turn can be submitted as real JCL code for further execution.

The lines
Code:
)SEL
)ENDSEL
are in fact special FTS statements, to be handled by FTS processor (invoked from a REXX script). Those lines cannot be processed as JCL, and you cannot submit this FTS skeleton as if it was a real JCL code.

In your specific case all those non-JCL lines are handled within JCL as in-stream data; the default DD is generated automatically:
Code:
//SYSIN DD * - generated as default
)SEL
)ENDSEL


Besides this, you are trying to use the JCL "// IF " statement to control the use of FTS ")SEL - )ENDSEL" groups. This is completely wrong: the JCL // IF is executed at JCL run time, after JCL submission, while )SEL-)ENDSEL statements are executed at FTS pre-processor stage, and before JCL submission.

And finally, RTFM about JCL syntax: the statements like // JCLLIB ORDER=... (as well as //JOBLIB DD) must precede any EXEC statement of this JCL.
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Mon Apr 25, 2022 11:01 am
Reply with quote

Thanks for your respond.

I got this and when i tried executing through rexx it got executed .

was doing some testing and wanted to run this a separate JCL then i executed it through rexx and it ran.

Thanks again
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Mon Apr 25, 2022 9:35 pm
Reply with quote

HI ,

Just misunderstood here my problem is still there. I want to call this JCL from rexx and in JCL as you can see when ENV is ECT0 the NTP100 proc should be picked from diffrent library and when ENV is NE ECT0 it should be picked from diffrent library . How i can achieve this here right now i am getting error which is understandable but how i can achieve this here. Right now when i am submitting it is getting erro as below .

Code:

J1234550 (SYSMSG) ------------- LINE         1 OF
COMMAND ===>                                     
FILE>   DCSQBTCH.J1234550.JOB08844.D0000004.JESYS
STMT NO. MESSAGE                                 
      23 IEFC019I MISPLACED JCLLIB STATEMENT     
      24 IEFC019I MISPLACED JOBLIB STATEMENT     
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Mon Apr 25, 2022 9:45 pm
Reply with quote

I want to submit the above JCL through rexx and in my second step where we are calling NTP0P100..i want to achieve this logic if ENV is Not equal to ECT0 this particular step should pick the proc from ALT0.TICTOC.MAINTAIN.PROCLIB this library and if ENV is ECT0 this proc should gets picked from another library ALT0.MAINTAIN.PROCLIB.

HOW I SHOULD CODE TO ACHIEVE THIS , SORRY FOR THE CONFUSION BUT I AM STILL STUCK HERE ANY HELP WOULD BE APPRECIATED.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Mon Apr 25, 2022 10:38 pm
Reply with quote

Digvijay Singh wrote:
HI ,

Just misunderstood here my problem is still there. I want to call this JCL from rexx and in JCL as you can see when ENV is ECT0 the NTP100 proc should be picked from diffrent library and when ENV is NE ECT0 it should be picked from diffrent library . How i can achieve this here right now i am getting error which is understandable but how i can achieve this here. Right now when i am submitting it is getting erro as below .

Code:

J1234550 (SYSMSG) ------------- LINE         1 OF
COMMAND ===>                                     
FILE>   DCSQBTCH.J1234550.JOB08844.D0000004.JESYS
STMT NO. MESSAGE                                 
      23 IEFC019I MISPLACED JCLLIB STATEMENT     
      24 IEFC019I MISPLACED JOBLIB STATEMENT     


Please, read my notes above regarding the positioning of JCLLIB, and JOBLIB within any JCL stream.
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Mon Apr 25, 2022 10:52 pm
Reply with quote

Hi Thank you for response.

I understand this error and what you are saying that the JCLIB and JOBLIB should only be coded once and.
ONLY ONE JCLLIB STATEMENT CAN BE CODED PER JOB
and JCLLIB MUST APPEAR AFTER JOB STMT AND BEFORE FIRST EXEC STMT. I know this my question is i want to achieve this below requirement as i stated above .

I want to call this JCL from rexx and in JCL as you can see when ENV is ECT0 the NTP100 proc should be picked from diffrent library and when ENV is NE ECT0 it should be picked from diffrent library . How i can achieve this here right now i am getting error which is understandable but how i can achieve this here.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Mon Apr 25, 2022 11:40 pm
Reply with quote

Digvijay Singh wrote:

I want to call this JCL from rexx

It is not possible to CALL any JCL from REXX, as I tried to explain above.
Your REXX is used to generate the JCL stream as a text data, which is further submitted for execution.

In your example there is also FTS used to help in JCL text generation, but this is not absolutely needed: REXX code could create this JCL by using its standard text-processing statements.

Digvijay Singh wrote:
and in JCL as you can see when ENV is ECT0 the NTP100 proc should be picked from diffrent library and when ENV is NE ECT0 it should be picked from diffrent library . How i can achieve this here right now i am getting error which is understandable but how i can achieve this here.


In your example you are trying to make changes to your JCL code at the time of execution, by checking the Return Code after one of JCL steps.
This is absolutely not possible.
The JCL text is submitted for execution as a fully complete script; there is absolutely no way to make any change in JCL code after it has been already submitted.

Technically, you can do the required changes in two ways:
1) using different // INCLUDE MEMBER=memname statements, and/or
2) using different JCL SET-variables
but anyway this must be done before your JCL is submitted.

One visible way to do what you want, but much easier:
- use your JCL // IF condition statements, to control execution of two different JCL steps, or group of steps,
- use different //STEPLIB DD (instead of common //JOBLIB DD) in two different branches of your JCL stream
- there is no way(!!!) to switch the // JCLLIB ORDER in the middle of you JCL execution; you need to find another way of making this change - though it is not clear, why do you want to change the PROCLIB in the middle of execution - ????? icon_rolleyes.gif

Likely, you wanted to use different versions of that JCL procedure, taken from different PROCLIB libraries? Again: it is not possible, because all PROCLIBs, and procedures expansion is performed before the JCL starts running; you cannot change it after JCL started its execution. You may need a re-named version of the same JCL procedure in two parts of your JCL.

But this approach looks quite senseless. Cannot guess: what is the reason to do it in this manner?

Take a look at two versions of NTP0P100 procedures in two of your PROCLIB libraries? What is the difference between them? With this information one can make the decision: what might be the way to fix this strange issue?
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Mon Apr 25, 2022 11:59 pm
Reply with quote

so you are saying i cannot use IF statement in my JCL? Please clarify this ?

One way of doing it so i dicided to check the ENV in rexx itself and then submit two diffrent JCL according to ENV like IF ENV=ECT0 submit diffrent skelton and if ECT0 NE ECT0 submit diffrent JCL skleton that will solve the problem i guess. But i am confused about the IF statement now you are saying i cant use IF condition n my skelton then how i should control the execution. my step should run only whne step 1 is completed with 00 or 04. Also please see whether my approach of doing so seems okay ?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Tue Apr 26, 2022 12:03 am
Reply with quote

Digvijay Singh wrote:
so you are saying i cannot use IF statement in my JCL? Please clarify this ?

One way of doing it so i dicided to check the ENV in rexx itself and then submit two diffrent JCL according to ENV like IF ENV=ECT0 submit diffrent skelton and if ECT0 NE ECT0 submit diffrent JCL skleton that will solve the problem i guess. But i am confused about the IF statement now you are saying i cant use IF condition n my skelton then how i should control the execution. my step should run only whne step 1 is completed with 00 or 04. Also please see whether my approach of doing so seems okay ?


You can use the JCL IF statement in your code, but only for the purpose where it can be used.

Try to understand the difference between JCL preparation stage, and JCL execution stage. You cannot mix those two stages, under no circumstances. icon_rolleyes.gif

It really depends on: what are the differences between the two versions of your JCL procedure, in two different PROCLIB libraries?????
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Tue Apr 26, 2022 1:07 am
Reply with quote

Hi Thanks for your response!!

I achieved it through puting condition in rexx and calling out seperate JCL skelton basis of ENV , still the if part needs to check whether its working or not because the data i have with that data my first step will always fails. Will get back here again and will try to leave the issue with clearity to everyone like what we did eventually once i have data to test complete JCL steps.


I thank you again !!!!
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Tue Apr 26, 2022 5:55 pm
Reply with quote

I believe your skeleton can be simplified as follows, if only I understand your intentions right:

1) the only thing you have to do in JCL customization is, replacing you PROCLIB based on the external parameter passed to FTS call

2) the statement // JCLLIB must be placed at the beginning of your JCL as per JCL syntax rules

3) the lines with //*JOBLIB are just the comment lines; their role in this skeleton is absolutely unclear

4) two opposite FTS )SEL-)ENDSEL can be easily replaced with )IF-)ELSE-)ENDIF. Those are not JCL // IF-ELSE-ENDIF statements!!!

5) the JCL statement // EXEC NTP0P100 does not need to be replaced with its exact copy

That's it

Code:
 ****** ***************************** Top of Data ******************************
 000001 //TIMSUBPJ JOB (DCS,058000DCS-058400,2TES-TC3,TESTTEAM),               
 000002 //     '&TIRID',CLASS=A,MSGCLASS=S                                     
 000003 //* DIGVIJAY JCL                                                       
 000004 //  SET TE=&SYSCHAR                                                     
 000005 //  SET TS=&TSTAGEC                                                     
 000006 //  SET CCID='&CCID'                                                   
 000007 //  SET TID='&TIRID'                                                   
 000008 //  SET PKG='&PACKAGE'                                                 
 000009 //*                                                                     
 000010 //**********************************************************************
 000011 //*            THIS JOB IS TO GET THE VALUES FROM REXX                 
 000012 //*            PACKAGE EXECUTE                                         
 000013 //***********************************************************
 000013 //**********************************************************************
 000047 )IF &ENV ¬= ECT0                                                       
 000048 //PROCLIB  JCLLIB  ORDER=(ALT0.TICTOC.MAINTAIN.PROCLIB)                 
 000049 //*JOBLIB   DD DISP=SHR,DSN=ALT0.MAINTAIN.LOADLIB                       
 000060 )ELSE                                                       
 000061 //PROCLIB  JCLLIB  ORDER=(ALT0.MAINTAIN.PROCLIB)           
 000062 //*JOBLIB   DD DISP=SHR,DSN=ALT0.MAINTAIN.LOADLIB
 000063 )ENDIF         
 000014 //JOBLIB   DD DISP=SHR,DSN=DB95.DSNEXIT                                 
 000015 //         DD DISP=SHR,DSN=DB95.DSNLOAD                                 
 000016 //         DD DISP=SHR,DSN=ALT0.PA.UTILITY.LOADLIB.NOFTP               
 000017 //         DD DISP=SHR,DSN=ALT0.MAINTAIN.LOADLIB                       
 000018 //*PROCLIB  JCLLIB ORDER=ALT0.TICTOC.MAINTAIN.PROCLIB                   
 000019 //*********************************************************************
 000020 //* SYMBOLICS: TE   = TEST ENVIRONMENT                                 
 000021 //*            TS   = TARGET ENDEVOR STAGE                             
 000022 //*            CCID = CCID                                             
 000023 //*            TID  = TIR ID                                           
 000024 //*            PKG  = PACKAGE NAME                                     
 000025 //*********************************************************************
 000026 //*                                                                     
 000027 //PACKEXEC EXEC PGM=IKJEFT1A,DYNAMNBR=1500,REGION=128M,                 
 000028 // PARM='PACKEXEC PRE &&TE &&TS &&CCID &&TID &&PKG'                     
 000029 //*                                                                     
 000030 //STEPLIB  DD DSN=DB95.DSNEXIT,DISP=SHR                                 
 000031 //         DD DSN=DB95.DSNLOAD,DISP=SHR                                 
 000032 //SYSEXEC  DD DSN=ALT0.MAINTAIN.CLIST,DISP=SHR                         
 000033 //SUMMARY  DD SYSOUT=*                                                 
 000034 //DETAIL   DD SYSOUT=*                                                 
 000035 //NDVRRPT  DD SYSOUT=*                                                 
 000036 //SYSTSPRT DD SYSOUT=*                                                 
 000037 //SYSTSIN  DD DUMMY                                                     
 000038 //PROJNAME DD *                                                         
 000039 &PROJNAME                                                               
 000040 /*                                                                     
 000041 //*                                                                     
 000042 //**********************************************************************
 000045 //**********************************************************************
 000046 //IF01 IF (PACKEXEC.RC = 0 OR PACKEXEC.RC = 4) THEN                     
 000050 // SET PARM=&PARM                                                       
 000051 // SET SYSENV=&ENV                                                     
 000052 // SET S=&SYSCHAR                                                       
 000053 // SET CP=&CDP                                                         
 000054 // SET SYSUID=&&SYSUID                                                 
 000055 // SET TIR=&TIRID                                                       
 000056 // SET NWCPYFLG=&NWCPYFLG                                               
 000057 //*                                                                     
 000058 //NTP0P100  EXEC NTP0P100                                               
 000073 //ENDIF01 ENDIF                                           
 000074 //                                                         
**********
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Tue Apr 26, 2022 8:34 pm
Reply with quote

Thank you once again, for explanations.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top