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

INREC statement syntax error while executing SYNCSORT code.


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

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Wed Jun 10, 2009 1:42 am
Reply with quote

Hello,

I'm trying to execute the following code and am getting an error :

Code:

//*************************************************************         
//****  SORT THE GPSI CUST UNLOAD FILE                     ****         
//*************************************************************         
//STEP1    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=ABC.DEF.GHI(0),DISP=SHR         
//SORTOUT  DD DSN=&&S1,DISP=(,PASS)                                     
//SYSIN    DD *                                                         
  INCLUDE COND=(1,23,CH,EQ,C'No. of records from aaa')                 
  INREC BUILD=(C'CONST1,+',151,12,UFF,ZD,LENGTH=12,80:X)               
  SORT FIELDS=COPY                                                     
/*                                                                     
//**********************************************************************
//STEP2 EXEC PGM=SORT,                                                 
//    PARM='DYNALLOC=(SYSDA,24),HIPRMAX=OPTIMAL,VSCORE=16M,VSCORET=64M'
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=ABC.DEF.GHI1(0)         
//SORTOUT  DD DSN=ABC.DEF.GHI.JLK(+1),                 
//          DISP=(,CATLG,DELETE),                                   
//          UNIT=SYSDA,RECFM=FB,                                       
//          SPACE=(CYL,(500,50),RLSE),BLKSIZE=0,                       
//          VOL=(,,,70)                                                                   
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                                 
//SYSIN    DD *                                                         
   INREC IFTHEN=(WHEN=(21,3,CH,EQ,C'aaa',OR,21,3,CH,EQ,C'bbb'),         
    BUILD=(1,160,165:C'     ')),                                       
       IFTHEN=(WHEN=(21,3,CH,NE,C'aaa',OR,21,3,CH,NE,C'bbb'),           
    BUILD=(1,160,165:(151,10,ZD),MUL,+100,DIV,CONST1,M10,LENGTH=5,C'%'))
   OPTION COPY                                                   
   OUTFIL FNAMES=SORTOUT,REMOVECC,                               
   HEADER1=(001:'**********PERSONAL PROF OVERALL STATS',45:&DATE)
                                                     
/*




Error :

Code:

INREC IFTHEN=(WHEN=(21,3,CH,EQ,C'KTC',OR,21,3,CH,EQ,C'WCC'),BUILD=(1,160,165:C'
N/A')),IFTHEN=(WHEN=(21,3,CH,NE,C'KTC',OR,21,3,CH,NE,C'WCC'),BUILD=(1,160,165:
151,10,ZD),MUL,+100,DIV,CONST1,M10,LENGTH=5,C'%')
*
OPTION COPY
OUTFIL FNAMES=SORTOUT,REMOVECC,HEADER1=(001:'**********PERSONAL PROF OVERALL ST
TS',45:&DATE)
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE



The asterisk in the error is present exactly at the value CONST1. Not sure whats the problem. these are pieces of code you provided before. The input file LRECL is 168.

Please help. I'm stuck here and not able to move fwd
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 10, 2009 2:57 am
Reply with quote

Quote:
...these are pieces of code you provided before. ...


Well come on and step up.
Whoever gave him the code is obviously responsible (TS thinks so, anyway).
So, give him his answer before he starts taking legal action against us.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jun 10, 2009 6:08 am
Reply with quote

surya4ug wrote:
these are pieces of code you provided before
surya4ug,

Glad that you said those were "pieces" of code.
Hint: Do you find any difference in the control statements used in your run JCL and those in your error messages?
dbzTHEdinosauer wrote:
So, give him his answer before he starts taking legal action
May be it's time I consult my advocate. icon_smile.gif
Back to top
View user's profile Send private message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Wed Jun 10, 2009 8:26 am
Reply with quote

Well,

I wanted to show where the error was and hence the gamble and i knew i would be getting back icon_smile.gif


So, here is the error:

Code:
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


and the asterisk thats generally shown near the 'problematic' part of the control statements, shows up near the CONST1 in the 2nd BUILD statement. I remember you mentioned before that i missed a few brances and i still don't get where exactly i missed them.

Please let me know if this is hasn't helped to explain the situation. Not sure what else is needed. icon_sad.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jun 10, 2009 11:23 am
Reply with quote

Your JCL wrote:
INREC IFTHEN=(WHEN=(21,3,CH,EQ,C'aaa',OR,21,3,CH,EQ,C'bbb')
................................
................................
BUILD=(1,160,165:(151,10,ZD),MUL,+100,DIV,CONST1,M10,LENGTH=5,C'%'))
................................
................................
Your Error Message wrote:
INREC IFTHEN=(WHEN=(21,3,CH,EQ,C'KTC',OR,21,3,CH,EQ,C'WCC')
................................
................................
BUILD=(1,160,165:
151
,10,ZD),MUL,+100,DIV,CONST1,M10,LENGTH=5,C'%')
................................
................................
surya4ug wrote:
I'm trying to execute the following code and am getting an error
You are not showing the output from the JCL that you said you submitted. I have highlighted the differences so that you can identify it. 36_2_51.gif
Back to top
View user's profile Send private message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Wed Jun 10, 2009 11:29 am
Reply with quote

Oh icon_smile.gif... my bad...... i intended to be generic while i pasted the code by mentioning aaa and bbb but forgot to change the values in the error message from KTC to aaa and WCC to bbb

The sysout also shows the same code icon_smile.gif

INREC IFTHEN=(WHEN=(21,3,CH,EQ,C'aaa',OR,21,3,CH,EQ,C'bbb')
................................
................................
BUILD=(1,160,165:(151,10,ZD),MUL,+100,DIV,CONST1,M10,LENGTH=5,C'%'))


By the way, nice emoticon...it made me smile icon_lol.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jun 10, 2009 11:43 am
Reply with quote

So..is it working now after the changes?
Back to top
View user's profile Send private message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Thu Jun 11, 2009 8:21 am
Reply with quote

No,

What i meant was, i just posted the control statements in the error wrongly. The error still exists near the CONST1 value.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Jun 11, 2009 8:37 am
Reply with quote

Hello,

It will probably help if you post the current jcl and control statements and the diagnostic info from the execution.

Please use the "Code" tag to improve readability.
Back to top
View user's profile Send private message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Thu Jun 11, 2009 9:03 am
Reply with quote

I used the following code and it worked now!! YAAY....


Code:
INREC IFTHEN=(WHEN=(21,3,CH,EQ,C'aaa',OR,21,3,CH,EQ,C'bbb'),       
    BUILD=(1,160,175:C'  N/A')),                                   
      IFTHEN=(WHEN=(21,3,CH,NE,C'aaa',OR,21,3,CH,NE,C'bbb'),       
BUILD=(1,160,175:(151,12,ZD),MUL,+100,DIV,CONST1,M10,LENGTH=5,C'%'))
OPTION COPY                                                         
OUTFIL FNAMES=SORTOUT,REMOVECC,                                     
HEADER1=(001:'**********PERSONAL PROF OVERALL STATS',45:&DATE)   
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jun 11, 2009 9:47 am
Reply with quote

surya4ug,

So what was your problem? what changes did you make to the control cards?
Back to top
View user's profile Send private message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Thu Jun 11, 2009 11:25 pm
Reply with quote

The problem was that in step1, i edited the constant manually in the input file for some reason and also in one occasion the constant came out to be zero and since we are tryinig to divide a field in step2 with this constant, the problem occured.

I Just tweaked the input file a bit and it worked fine. No real syntax errors found. Having fun with SYNCSORT, courtesy Mr. Arun icon_cool.gif

Thanks for looking into it!
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jun 11, 2009 11:30 pm
Reply with quote

surya4ug wrote:
Having fun with SYNCSORT, courtesy Mr. Arun icon_cool.gif

Thanks for looking into it!
You're welcome. Thanks for the follow up. It's really an amazing utility. icon_smile.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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts purge jobs with return code 0 and ret... JCL & VSAM 4
No new posts IEW2315E 1369 Link error All Other Mainframe Topics 3
No new posts Executing DB2 SQL store procedure via... DB2 0
No new posts Syncsort help SYNCSORT 3
No new posts Help on IMS -API URL migrating from P... IMS DB/DC 1
Search our Forums:

Back to Top