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

INREC SYNTAX ERROR IN WHEN=GROUP STATEMENT


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

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Sat Sep 27, 2008 2:20 am
Reply with quote

Can someone suggest how to get rid of the error in the following JCL.

JCL STEP USED:

Code:

//STEP0100 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=FILE1,DISP=SHR
//         DD DSN=FILE2,DISP=SHR
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=(1,8,CH,A)
  INREC IFTHEN=(WHEN=GROUP,
        BEGIN=(9,4,CH,EQ,C'RPT='),PUSH=(41:13,8))
  OUTFIL INCLUDE=(41,8,CH,GT,C' ',AND,9,4,CH,NE,C'RPT='),
  BUILD=(1,8,41,8,9,5)
/*



FILE1:-
AY19501 RPT=RAY19501
AY19505 RPT=RAY19505
AY19506 RPT=RAY19506

FILE2:-
AY19501 5286 119705/29/07
AY19501 5287 67705/30/07
AY19501 5288 71305/31/07
AY19505 5288 71705/31/07
AY19505 5289 70606/01/07
AY19506 5289 70706/01/07
AY19506 5291 80906/05/07
AY19506 5292 123606/06/07

ERROR MESSAGES:

SYNCSORT FOR Z/OS 1.2.2.3R U.S. PATENTS: 4210961, 5117495 (C) 2005 SYNCSO
z/OS 1.8.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 1C2AD, MODEL 2096 U03 LICEN
SYSIN :
SORT FIELDS=(1,8,CH,A)
INREC IFTHEN=(WHEN=GROUP,
*
BEGIN=(9,4,CH,EQ,C'RPT='),PUSH=(41:13,8))
OUTFIL INCLUDE=(41,8,CH,GT,C' ',AND,9,4,CH,NE,C'RPT='),
BUILD=(1,8,41,8,9,5)
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Thanks in Advance

Regards
-Manohar
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Sep 27, 2008 2:34 am
Reply with quote

this is not Your first post on on sort issues
You should know by now that WER..... messages are SYNCSORT related

and You should post to the jcl forum

I' ll move the topic
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Sat Sep 27, 2008 3:09 am
Reply with quote

Quote:
SYNCSORT FOR Z/OS 1.2.2.3R

WER268A INREC STATEMENT : SYNTAX ERROR

SyncSort for z/OS 1.2 does not contain support for the WHEN=GROUP function.

You can accomplish this using SyncSort's JOIN feature instead. I'll post an example shortly.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Sat Sep 27, 2008 3:23 am
Reply with quote

Try this:
Code:
//SORT1  EXEC PGM=SORT
//SORTJNF1 DD *       
AY19501 5286         
AY19501 5287         
AY19501 5288         
AY19505 5286         
AY19505 5287         
AY19506 5286         
AY19506 5287         
//SORTJNF2 DD *       
AY19501 RPT=RAY19501 
AY19505 RPT=RAY19505 
AY19506 RPT=RAY19506 
//SORTOUT  DD SYSOUT=*
//SYSOUT   DD SYSOUT=* 
//SYSIN    DD *                           
   JOINKEYS FILES=F1,FIELDS=(1,8,A)     
   JOINKEYS FILES=F2,FIELDS=(1,8,A)     
   REFORMAT FIELDS=(F2:1,8,13,8,F1:8,5)
   SORT FIELDS=COPY                     
/*         
Back to top
View user's profile Send private message
manoopatil

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Sat Sep 27, 2008 10:08 pm
Reply with quote

Yes!!! It worked perfectly fine. Thank you so much Alissa!

Many programmers including me write a cobol program for this kind of functionality!

Thanks
-Manohar
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 PARSE Syntax for not fix length word ... JCL & VSAM 7
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
Search our Forums:

Back to Top