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
 

 

How to use OMIT statements multiple times in control card.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to use OMIT statements multiple times in control card.
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: 6967
Location: porcelain throne

PostPosted: Fri Jan 15, 2010 3:45 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jan 15, 2010 3:49 pm    Post subject:
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    Post subject:
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    Post subject:
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    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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts PA02 - Programmtically control attent... dodithegreat IMS DB/DC 1 Thu Apr 06, 2017 8:33 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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