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

Misplaced statement error


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Nithya Usha Mohanan

New User


Joined: 16 Oct 2007
Posts: 7
Location: pune

PostPosted: Thu May 05, 2011 7:51 pm
Reply with quote

Hi,

I am executing a jcl calling a proc and getting a strange error while doing JCK in changeman.

After the proc getting called in the first step of the proc viz

//PROCNAME PROC CNTL = 'abc.xyz.deg',

// UNIT = 'sysda'


it is giving error " Misplaced statement" . the next statement is

//EXEC PGM = IEFBR14
the calling JCl looks fine and the proc is getting called too...

Could you please suggest me the reasons of this error?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu May 05, 2011 7:59 pm
Reply with quote

My best guess is, since UNIT is a reserved word, that it appears to be misplaced. You should probably try something else, like UNT.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu May 05, 2011 7:59 pm
Reply with quote

Whoops, I replied whilst superk was moving it. Content no longer relevant.
Back to top
View user's profile Send private message
Nithya Usha Mohanan

New User


Joined: 16 Oct 2007
Posts: 7
Location: pune

PostPosted: Thu May 05, 2011 8:05 pm
Reply with quote

thanks superk,

but i ran it commenting unit out , still not working....


regards,
nithya
Back to top
View user's profile Send private message
ridgewalker58

New User


Joined: 26 Sep 2008
Posts: 51
Location: New York

PostPosted: Thu May 05, 2011 8:06 pm
Reply with quote

Without any more information than what you provided, I can only make ASSUMPTIONS:

I have to ASSUME that the line //EXEC PGM = IEFBR14
is EXACTLY as you coded it:

Therefore, I would ALSO give you JCL error.

The format of an EXECUTE statement is:

'//' followed by a STEPNAME or atleast one SPACE
followed by EITHER
"EXEC PGM=your program name"
or
"EXEC PROCNAME"

for example:

//STEP001 EXEC PGM=IEFBR14

****** WITH NO SPACES IN THE PGM=IEFBR14
Back to top
View user's profile Send private message
ridgewalker58

New User


Joined: 26 Sep 2008
Posts: 51
Location: New York

PostPosted: Thu May 05, 2011 8:09 pm
Reply with quote

I had assumed that UNIT had been a Symbolic parameter which was defined WITHIN the PROC

UNIT=&UNIT
&UNIT to be replaced in the Execution JCL with
something like UNIT=SYSDA
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu May 05, 2011 8:13 pm
Reply with quote

Nevermind, I just tested that PROC, and it works fine with UNIT as a symbolic parameter.

I don't have JCK or Changeman available, so I can't comment further.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Thu May 05, 2011 8:19 pm
Reply with quote

Unless we see code cut&pasted between code tags, we are wasting our time.
Back to top
View user's profile Send private message
ridgewalker58

New User


Joined: 26 Sep 2008
Posts: 51
Location: New York

PostPosted: Thu May 05, 2011 8:31 pm
Reply with quote

Superk, Bill and Phil -- I have noticed that you "all" spend time answering questions and giving solutions ---- BUT I have noticed
that RARELY the person who is asking the question -- has the
time to give you the response " yes it worked"

I believe the problem is that he coded it as

//EXEC PGM = IEFBR14

instead of

//STEP001 EXEC PGM=IEFBR14
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Thu May 05, 2011 8:33 pm
Reply with quote

I absolutely agree - and cut&pasted code would have shown that right away.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Thu May 05, 2011 8:34 pm
Reply with quote

There are a lot of loose ends in your question, Nithya.

Quote:
error while doing JCK in changeman
Does it work when you are not in Change-Man. Change-Man has many sub-routines, which might cause such problems but they are site specific. Such as, at one of my shop, we were supposed to have a component of type "JCQ", which will have all the RESTART and any other relevant info for the corresponding Job - without it, syntax check wil show some weired error.

Quote:
it is giving error " Misplaced statement" . the next statement is
What is "next" here? why do you look at "next statement" and why not at the exact statement which is flagged?
Back to top
View user's profile Send private message
Nithya Usha Mohanan

New User


Joined: 16 Oct 2007
Posts: 7
Location: pune

PostPosted: Thu May 05, 2011 8:55 pm
Reply with quote

Hi everyone,

Thanks for all ur suggestion.This issue is now resolved,
but the real culprit was a set of comments given before the

(procname) PROC statement in the proc . Since it was not my proc and JCl and i was helping in resolving the error, it didnt cross my mind at all abt the comments given at the starting of the proc ... icon_smile.gif Now i have given it after the PROC statement and things are working fine...

but the confusion was bcoz the error was flagged at the PROC statement.


I should really say thank you to everyone in this site coz whenever i am really facing an issue i really depend on the many comments and help available here...
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Thu May 05, 2011 9:02 pm
Reply with quote

Glad to hear that!
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu May 05, 2011 9:17 pm
Reply with quote

ridgewalker58 wrote:
Superk, Bill and Phil -- I have noticed that you "all" spend time answering questions and giving solutions ---- BUT I have noticed
that RARELY the person who is asking the question -- has the
time to give you the response " yes it worked"



Perhaps I rarely give the correct solution? icon_smile.gif This time, I was just whining about it being in the Cobol forum. Since we got some thanks anyway, perhaps I should do it more often...
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Jun 07, 2011 9:38 pm
Reply with quote

Quote:
Thanks for all ur suggestion.This issue is now resolved,
but the real culprit was a set of comments given before the

(procname) PROC statement in the proc .


the conclusion is WRONG

I got curious and checked

here is the job
Code:
****** ***************************** Top of Data ******************************
000001 //ENRICO@A JOB (ACCT#),'ZPROC',NOTIFY=ENRICO,
000002 //             CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
000003 //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
000004 //*            DSN=ENRICO.TEST.JCL(IEFBR14)
000005 //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
000006 // JCLLIB      ORDER=(ENRICO.TEST.JCL)
000007 //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
000008 //*
000009 //S0      EXEC ZPROC
****** **************************** Bottom of Data ****************************



and here the proc
note the comments before the PROC statement
Code:
****** ***************************** Top of Data ******************************
000001 //*
000002 //* BEFORE
000003 //*
000004 //ZPROC   PROC P=IEFBR14
000005 //IEF     EXEC PGM=&P
000006 //SYSPRINT  DD SYSOUT=*
****** **************************** Bottom of Data ****************************


and it was happily executed
Code:
********************************* TOP OF DATA **********************************
J E S 2  J O B  L O G  --  S Y S T E M  S Y S 1  --  N

09.59.09 JOB00299 ---- TUESDAY,   07 JUN 2011 ----
09.59.09 JOB00299  IRR010I  USERID ENRICO   IS ASSIGNED TO THIS JOB.
09.59.10 JOB00299  ICH70001I ENRICO   LAST ACCESS AT 09:58:53 ON TUESDAY, JUNE 7
09.59.10 JOB00299  $HASP373 ENRICO@A STARTED - INIT 1    - CLASS A - SYS SYS1
09.59.10 JOB00299  IEF403I ENRICO@A - STARTED - TIME=09.59.10
09.59.10 JOB00299  IEF404I ENRICO@A - ENDED - TIME=09.59.10
09.59.10 JOB00299  $HASP395 ENRICO@A ENDED
------ JES2 JOB STATISTICS ------
  07 JUN 2011 JOB EXECUTION DATE
            9 CARDS READ
           43 SYSOUT PRINT RECORDS
            0 SYSOUT PUNCH RECORDS
            2 SYSOUT SPOOL KBYTES
         0.00 MINUTES EXECUTION TIME
        1 //ENRICO@A JOB (ACCT#),'ZPROC',NOTIFY=ENRICO,
          //             CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
          //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          //*            DSN=ENRICO.TEST.JCL(IEFBR14)
          //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        2 // JCLLIB      ORDER=(ENRICO.TEST.JCL)
          //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          //*
        3 //S0      EXEC ZPROC
          XX*
          XX* BEFORE
          XX*
        4 XXZPROC   PROC P=IEFBR14
        5 XXIEF     EXEC PGM=&P
          IEFC653I SUBSTITUTION JCL - PGM=IEFBR14
        6 XXSYSPRINT  DD SYSOUT=*
STMT NO. MESSAGE
        3 IEFC001I PROCEDURE ZPROC WAS EXPANDED USING PRIVATE LIBRARY ENRICO.TES
ICH70001I ENRICO   LAST ACCESS AT 09:58:53 ON TUESDAY, JUNE 7, 2011
IEF236I ALLOC. FOR ENRICO@A IEF S0
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF142I ENRICO@A IEF S0 - STEP WAS EXECUTED - COND CODE 0000
IEF285I   ENRICO.ENRICO@A.JOB00299.D0000101.?          SYSOUT
IEF373I STEP/IEF     /START 2011158.0959
IEF374I STEP/IEF     /STOP  2011158.0959 CPU    0MIN 00.01SEC SRB    0MIN 00.00S
IEF375I  JOB/ENRICO@A/START 2011158.0959
IEF376I  JOB/ENRICO@A/STOP  2011158.0959 CPU    0MIN 00.01SEC SRB    0MIN 00.00S
******************************** BOTTOM OF DATA ********************************


as usually we wasted time on symptoms due to a broken jcl checker
and to the scarce analysis skill of the ts
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Wed Jun 08, 2011 1:31 pm
Reply with quote

Have fun, enrico! icon_wink.gif
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 -> ABENDS & Debugging

 


Similar Topics
Topic Forum Replies
No new posts Help on IMS -API URL migrating from P... IMS DB/DC 1
No new posts JES datasets IO Error ABENDS & Debugging 3
No new posts Error to invoke MPP program through B... IMS DB/DC 3
No new posts PKZIP error ZPFM121E and ZPCE009E JCL & VSAM 6
No new posts OpenPGP Decryption job getting LRECL ... IBM Tools 7
Search our Forums:

Back to Top