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

Insert record @ EOF


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

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Wed Nov 12, 2008 11:20 pm
Reply with quote

I'm comparexing two control cards. When different, I want to take one control card and build a new control card.

I have input file
File Edit Edit_Settings Menu Utilities Com

Code:
                                       
EDIT     SORTIN DSN=P###.W@@@.WD.PWDD#@@V.VTB181S1.SRT   
Command ===>                                     
****** ***************************** Top of Data**************
 OMIT COND=((21,9,CH,EQ,C'831804109'),   
                 OR,(21,9,CH,EQ,C'52470R888'),   
                 OR,(21,9,CH,EQ,C'92204L203'))
****** **************************** Bottom of Data ************


I want output to be:

Code:

EDIT       SORTOUT DSN=P###.W@@@.WD.PWDD#@@SORTOUT   
Command ===>                                     
****** ***************************** Top of Data************
 OMIT COND=((24,9,CH,EQ,C'831804109'), 
        OR,(24,9,CH,EQ,C'52470R888'),
        OR,(24,9,CH,EQ,C'92204L203'))
 OUTREC FIELDS=(1C'*',2,349)
 SORT FIELDS=COPY           
****** **************************** Bottom of Data *********


I have tried:

Code:

 OUTFIL FNAMES=SORTOUT,                           
     IFTHEN=(WHEN=(14,2,CH,EQ,C'21'),           
        OVERLAY=(14:C'24'))                     
 TRAILER1=(2:C'SORT FIELDS=COPY'),               
 TRAILER2=(2:C'OUTREC FIELDS=(1C'*',2,349)')     
 SORT FIELDS=COPY                                 


It does the overlay fine. I'm having problems with the adding the two last lines as trailer records.

Thanks.
Ywheeler
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: Thu Nov 13, 2008 12:10 am
Reply with quote

You can use these DFSORT control statements:

Code:

  OPTION COPY                                         
  OUTFIL REMOVECC,                                   
     IFTHEN=(WHEN=(14,2,CH,EQ,C'21'),                 
        OVERLAY=(14:C'24')),                         
     TRAILER1=(2:C'SORT FIELDS=COPY',/,               
       2:C'OUTREC FIELDS=(1C''*'',2,349)')           
Back to top
View user's profile Send private message
ywheeler

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Thu Nov 13, 2008 1:02 am
Reply with quote

Frank, thank you for the quick response. What is REMOVECC ?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Nov 13, 2008 1:12 am
Reply with quote

ywheeler,

When you use report features like header,trailer .., DFSORT will add an additional byte in the begining of the record which will have the ANSI carriage control character. So the LRECL is increased by 1 byte. for example if you have 80 byte FB file and you use reporting features then the output dataset will have 81 byte lrecl and recfm is FBA.

Removecc specifies that the ANSI carriage control character(print) is to be removed from OUTFIL output records for this OUTFIL group before the records are written.DFSORT will set the LRECL to 80 instead of 81 and remove the ANSI carriage control character from each record before it is written.
Back to top
View user's profile Send private message
ywheeler

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Thu Nov 13, 2008 1:18 am
Reply with quote

Thank you for the explaination.
Now when I follow the previous advice, I get an error:


Code:
 
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT
          OPTION=COPY                                   
            OUTFIL REMOVECC,                           
               IFTHEN=(WHEN=(14,2,CH,EQ,C'21'),         
                  OVERLAY=(14:C'24')),                 
               TRAILER1=(2:C'SORT FIELDS=COPY',/,       
                 2:C'OUTREC FIELDS=(1C''*'',2,349)')   
ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT           
ICE751I 0 C5-K26318 C6-K90007 E7-K24705                 
ICE052I 3 END OF DFSORT
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Nov 13, 2008 1:22 am
Reply with quote

ywheeler,

You have OPTION=COPY in your control cards which is not a valid DFSORT Control statement. It should be

Code:

  OPTION COPY


OR
Code:
 SORT FIELDS=COPY


Change that and re-run your job
Back to top
View user's profile Send private message
ywheeler

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Thu Nov 13, 2008 1:27 am
Reply with quote

Same error:

Code:

ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFS
          SORT FIELDS=COPY                           
               $                                     
ICE005A 0 STATEMENT DEFINER ERROR                   
            OUTFIL REMOVECC,                         
               IFTHEN=(WHEN=(14,2,CH,EQ,C'21'),     
                  OVERLAY=(14:C'24')),               
               TRAILER1=(2:C'SORT FIELDS=COPY',/,   
                 2:C'OUTREC FIELDS=(1C''*'',2,349)')
ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT         
ICE751I 0 C5-K26318 C6-K90007 E7-K24705             
ICE052I 3 END OF DFSORT
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Nov 13, 2008 1:29 am
Reply with quote

ywheeler,

Make sure that your SORT FIELDS=COPY statements starts in pos 2
Back to top
View user's profile Send private message
ywheeler

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Thu Nov 13, 2008 1:31 am
Reply with quote

Thank you so much.
That did it.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top