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

Omit record to write into file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
p_gandhi

New User


Joined: 20 Apr 2007
Posts: 14
Location: TORONTO,ONTARIO,CANADA

PostPosted: Fri Oct 12, 2007 10:32 pm
Reply with quote

Hi,
I am trying to omit some of the records from the given file with
OMIT COND=
Now I am looking for all the records which I omit in the file for the verifaction.
How do I get those record into file? My codes as below

Code:

//SYSIN    DD  *                       
    SORT FIELDS=(136,7,PD,A,           
                 143,2,PD,A,           
                 1,30,CH,A,             
                 289,26,CH,A,           
                 41,20,CH,A,           
                 61,20,CH,A,           
                 81,25,CH,A)           
     OUTREC FIELDS=(1,380)             
     OMIT COND=(143,2,BI,EQ,X'0000',AND,
         1,30,CH,EQ,C' ',AND,           
         31,10,CH,EQ,C' ',AND,         
         41,20,CH,EQ,C' ',AND,         
         61,20,CH,EQ,C' ',AND,         
         81,25,CH,EQ,C' ',AND,         
         106,10,CH,EQ,C' ',AND, 
         116,20,CH,EQ,C' ',AND, 
         283,2,BI,EQ,X'0000')   
/*                             
//
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 12, 2007 10:47 pm
Reply with quote

If you want to verify the records with a separate job, just create another job where you have INCLUDE instead of OMIT. Remove the OUTREC statement if you don't want to reformat the verify records.

If you want to verify the records in the same job, you can use OUTFIL OMIT and OUTFIL SAVE as in this DFSORT job. SAVE will keep the records that are omitted by OMIT. I assumed you wanted to reformat the OUT1 records but not the OUT2 records. If you want to reformat the OUT2 records, add ',BUILD=(1,380)' to the second OUTFIL statement.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//OUT1 DD DSN=...    output file
//OUT2 DD DSN=...  output file
//SYSIN DD *
  SORT FIELDS=(136,7,PD,A,
      143,2,PD,A,
      1,30,CH,A,
      289,26,CH,A,
      41,20,CH,A,
      61,20,CH,A,
      81,25,CH,A)
  OUTFIL FNAMES=OUT1,
   OMIT=(143,2,BI,EQ,X'0000',AND,
    1,30,CH,EQ,C' ',AND,
    31,10,CH,EQ,C' ',AND,
    41,20,CH,EQ,C' ',AND,
    61,20,CH,EQ,C' ',AND,
    81,25,CH,EQ,C' ',AND,
    106,10,CH,EQ,C' ',AND,
    116,20,CH,EQ,C' ',AND,
    283,2,BI,EQ,X'0000'),
   BUILD=(1,380)
  OUTFIL FNAMES=OUT2,SAVE
/*
Back to top
View user's profile Send private message
p_gandhi

New User


Joined: 20 Apr 2007
Posts: 14
Location: TORONTO,ONTARIO,CANADA

PostPosted: Fri Oct 12, 2007 11:19 pm
Reply with quote

Hi,
Coded as you showed here, but I am getting follwoing errors

Code:

                          81,25,CH,A)                 **NAME LAST               
             OUTFIL FNAMES=OUT1                                                 
              OMIT COND=(143,2,BI,EQ,X'0000',AND,                               
                  1,30,CH,EQ,C' ',AND,                                         
                  31,10,CH,EQ,C' ',AND,                                         
                  41,20,CH,EQ,C' ',AND,                                         
                  61,20,CH,EQ,C' ',AND,                                         
                  81,25,CH,EQ,C' ',AND,                                         
                  106,10,CH,EQ,C' ',AND,                                       
                  116,20,CH,EQ,C' ',AND,                                       
                  283,2,BI,EQ,X'0000')                                         
              BUILD=(1,380)                                                     
              $                                                                 
ICE005A 0 STATEMENT DEFINER ERROR                                               
             OUTFIL FNAMES=OUT2,SAVE                                           
ICE751I 0 C5-K90007 C6-K90007 C7-K90000 C8-K90007 E7-K11698                     
ICE052I 3 END OF DFSORT                                                         


. . . . . . . . . . . . . . . . . . . . . . . . . . .
Please help me to solve this problem thanks again for your quick reply
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Oct 12, 2007 11:33 pm
Reply with quote

Hello,

Quote:
283,2,BI,EQ,X'0000')
It looks like you've omitted the comma on this line. . .

Please check your code against what Frank posted.
Back to top
View user's profile Send private message
p_gandhi

New User


Joined: 20 Apr 2007
Posts: 14
Location: TORONTO,ONTARIO,CANADA

PostPosted: Fri Oct 12, 2007 11:45 pm
Reply with quote

Sorry for the rouble but if I add that ,(comma) before that line I am getting following error
61,20,CH,A, **NAME MID
81,25,CH,A) **NAME LAST
OUTFIL FNAMES=OUT1
OMIT COND=(143,2,BI,EQ,X'0000',AND,
1,30,CH,EQ,C' ',AND,
31,10,CH,EQ,C' ',AND,
41,20,CH,EQ,C' ',AND,
61,20,CH,EQ,C' ',AND,
81,25,CH,EQ,C' ',AND,
106,10,CH,EQ,C' ',AND,
116,20,CH,EQ,C' ',AND,
283,2,BI,EQ,X'0000'),
BUILD=(1,380)
$
ICE103A 0 INVALID INCLUDE OR OMIT STATEMENT OPERAND
OUTFIL FNAMES=OUT2,SAVE
ICE751I 0 C5-K90007 C6-K90007 C7-K90000 C8-K90007 E7-K11698
ICE052I 3 END OF DFSORT

Also I tried his codes and giving me error message for this kind where he ask me to put comma so I remove commas

1) OUTFIL FNAMES=OUT1
2)283,2,BI,EQ,X'0000'),
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 12, 2007 11:45 pm
Reply with quote

Paresh,

I erroneously had OMIT COND= instead of OMIT=. I've fixed up the job - please go back and copy it again exactly as it now appears. (That will teach me to take shortcuts and not test the job.)
Back to top
View user's profile Send private message
p_gandhi

New User


Joined: 20 Apr 2007
Posts: 14
Location: TORONTO,ONTARIO,CANADA

PostPosted: Fri Oct 12, 2007 11:54 pm
Reply with quote

Thank you very much everybody; its working Pefect the way I was looking for
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top