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

How to use OMIT statements multiple times in control card.


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

New User


Joined: 22 Mar 2007
Posts: 57
Location: India

PostPosted: Fri Jan 15, 2010 3:32 pm
Reply with quote

I have a requirement wherein i have following case,

INPUT:
Code:
ACCT1               
TXN1   AMOUNT1  DATE1
TXN2   AMOUNT2  DATE2
TXN3   AMOUNT3  DATE3
                     
ACCT2               
TXN4   AMOUNT4  DATE4
TXN5   AMOUNT5  DATE5

REQUIRED OUTPUT:
Code:
ACCT1 TXN1 AMOUNT1  DATE1
ACCT1 TXN2 AMOUNT2  DATE2
ACCT1 TXN3 AMOUNT3  DATE3
ACCT2 TXN4 AMOUNT4  DATE4
ACCT2 TXN5 AMOUNT5  DATE5

My JCL uses ICEMAN with following Control Card:
Code:
//SYSIN    DD    *                                                 
  OPTION COPY                                                       
  OMIT COND=(1,4,CH,EQ,C' ')                                       
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'ACCT'),PUSH=(30:1,5))
  OUTREC FIELDS=(1:30,5,7:01,04,12:8,7,21:17,5)                     
/*                                                                 

The OUTPUT I got is :
Code:
ACCT1 ACCT               
ACCT1 TXN1 AMOUNT1  DATE1
ACCT1 TXN2 AMOUNT2  DATE2
ACCT1 TXN3 AMOUNT3  DATE3
ACCT2 ACCT               
ACCT2 TXN4 AMOUNT4  DATE4
ACCT2 TXN5 AMOUNT5  DATE5

This output contains 2 extra lines.
To remove it if i use,
Code:
OMIT COND=(12,8,CH,EQ,C' ') 

It gives me error as,
Code:
SYSIN :                                                           
  OPTION COPY                                                     
  OMIT COND=(1,4,CH,EQ,C' ')                                       
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'ACCT'),PUSH=(30:1,5))
  OUTREC FIELDS=(1:30,5,7:01,04,12:8,7,21:17,5)                   
  OMIT COND=(12,8,CH,EQ,C' ')                                     
  *                                                               
WER269A  OMIT STATEMENT    : DUPLICATE STATEMENT FOUND             
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                     
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                     


Please HELP... icon_redface.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Jan 15, 2010 3:45 pm
Reply with quote

this should be in the SYNCSORT forum.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jan 15, 2010 3:49 pm
Reply with quote

dbzTHEdinosauer wrote:
this should be in the SYNCSORT forum.

And your wish is granted Sire

Deepakgoyal2005
Have you looked at the manuals, or the JCL or DFSORT forums for the syntax of the OMIT parameter. And also google will help you.
Back to top
View user's profile Send private message
Deepakgoyal2005

New User


Joined: 22 Mar 2007
Posts: 57
Location: India

PostPosted: Mon Jan 18, 2010 10:03 am
Reply with quote

Hi Expat,

I had googled on my requirement and have looked into the DFSORT manual and haven't got any relevant information.

There may be a little workaround needed in my control card but i am not getting it.
Back to top
View user's profile Send private message
Deepakgoyal2005

New User


Joined: 22 Mar 2007
Posts: 57
Location: India

PostPosted: Mon Jan 18, 2010 10:52 am
Reply with quote

I tried with ICETOOL with a little workaround on the previous logic and it worked for me.
Following is the code used by me,

JCL:
Code:
//STEP010 EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//INPUT    DD *                                                     
ACCT1                                                               
TXN1   AMOUNT1  DATE1                                               
TXN2   AMOUNT2  DATE2                                               
TXN3   AMOUNT3  DATE3                                               
                                                                     
ACCT2                                                               
TXN4   AMOUNT4  DATE4                                               
TXN5   AMOUNT5  DATE5                                               
//OUTPUT   DD SYSOUT=*                                               
//TOOLIN   DD *                                                     
  COPY FROM(INPUT) USING(CTL1)                                       
//CTL1CNTL DD *                                                     
  OMIT=(1,4,CH,EQ,C' ')                                             
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'ACCT'),PUSH=(30:1,5)) 
  OUTFIL FNAMES=OUTPUT,BUILD=(1:30,5,7:01,04,12:8,7,21:17,5),       
  OMIT=(12,8,CH,EQ,C' ')                                             
/*                                                                   

Result:
Code:
ACCT1 TXN1 AMOUNT1  DATE1
ACCT1 TXN2 AMOUNT2  DATE2
ACCT1 TXN3 AMOUNT3  DATE3
ACCT2 TXN4 AMOUNT4  DATE4
ACCT2 TXN5 AMOUNT5  DATE5
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top