Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

INREC SYNTAX ERROR IN WHEN=GROUP STATEMENT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: INREC SYNTAX ERROR IN WHEN=GROUP STATEMENT
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10275
Location: italy

PostPosted: Sat Sep 27, 2008 2:34 am    Post subject: Reply to: INREC SYNTAX ERROR IN WHEN=GROUP STATEMENT
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: 500
Location: USA

PostPosted: Sat Sep 27, 2008 3:09 am    Post subject: Reply to: INREC SYNTAX ERROR IN WHEN=GROUP STATEMENT
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: 500
Location: USA

PostPosted: Sat Sep 27, 2008 3:23 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am
No new posts INREC PARSING and dictionary items migusd SYNCSORT 6 Fri Jun 02, 2017 8:02 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us