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

DFSORT-Delete and Overide the Data


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

New User


Joined: 26 Sep 2007
Posts: 24
Location: Bangalore

PostPosted: Tue Dec 18, 2007 12:01 pm
Reply with quote

Hi,

I have the data from the file in this format.
Code:

*************************************
*********NOT FOUND FILE**************
*********JOB XXXXXXXX***************
TOTAL RECORDS IN XXXXXXXXXX1:          0
TOTAL RECORDS IN XXXXXXXXXX2:          0
TOTAL RECORDS IN XXXXXXXXXX3:          0
TOTAL RECORDS IN XXXXXXXXXX4:          0
TOTAL RECORDS IN XXXXXXXXXX5:          0
TOTAL RECORDS IN XXXXXXXXXX6:          0
TOTAL RECORDS IN XXXXXXXXXX7:          0



In need to write the file 4 and file 5 to the output and it should appear in the output file in different format as shown below.
Code:

COUNT OF RECORDS IN XXXXXXX4:          0
COUNT OF RECORDS IN XXXXXXX5:          0




I used ICETOOL to sort the file and the control card I used is shown below will only overlay the records in the file with the format required. I want the records only which I overlayed not all the records.

Code:

OUTFIL FNAMES=OUT01,                                             
       IFTHEN=(WHEN=INIT,                                       
                PARSE=(%00=(ENDBEFR=C':',FIXLEN=28),             
                       %01=(FIXLEN=11))),                       
       IFTHEN=(WHEN=(2,28,CH,EQ,TOTAL RECORDS IN XXXXXXXXXX4:'),
                BUILD=(2:C'COUNT OF RECORDS IN XXXXXXX4:',31:%01)),                     
       IFTHEN=(WHEN=(2,28,CH,EQ,TOTAL RECORDS IN XXXXXXXXXX5:'),
                BUILD=(2:C'COUNT OF RECORDS IN XXXXXXX5:',31:%01))
                     


I am trying with IFTHEN and PARSE statment for the first time. However, same function can be done splitting the operation in two steps.First step to extract the required record from the file and the overlay the records in the next step.
Here my question is can we do the above function in one step using the ICETOOL SORT CARD . If the question is not clear i will post the JCL also.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Dec 18, 2007 2:54 pm
Reply with quote

Praveen,

Try the following JCL -

Code:
//S@ EXEC PGM=SORT                                   
//SYSOUT DD SYSOUT=*                                 
//SYSPRINT DD SYSOUT=*                               
//SORTIN DD *                                       
*************************************               
*********NOT FOUND FILE**************               
*********JOB XXXXXXXX***************                 
TOTAL RECORDS IN XXXXXXXXXX1:          0             
TOTAL RECORDS IN XXXXXXXXXX2:          0             
TOTAL RECORDS IN XXXXXXXXXX3:          0             
----+----1----+----2----+----3----+----4----+----5---
TOTAL RECORDS IN XXXXXXXXXX4:          0             
TOTAL RECORDS IN XXXXXXXXXX5:          0             
TOTAL RECORDS IN XXXXXXXXXX6:          0             
TOTAL RECORDS IN XXXXXXXXXX7:          0             
/*                                                   
//SORTOUT DD SYSOUT=*                                                   
//SYSIN DD *                                                           
  OPTION COPY                                                           
  OUTREC IFTHEN=(WHEN=(1,28,CH,EQ,C'TOTAL RECORDS IN XXXXXXXXXX4',OR,   
                 1,28,CH,EQ,C'TOTAL RECORDS IN XXXXXXXXXX5'),           
           BUILD=(C'COUNT OF RECORDS IN ',                             
                    18,23))                                             
/*                                                                     


O/P:

Code:
----+----1----+----2----+----3----+----4----+----5----+--
*************************************                   
*********NOT FOUND FILE**************                   
*********JOB XXXXXXXX***************                     
TOTAL RECORDS IN XXXXXXXXXX1:          0                 
TOTAL RECORDS IN XXXXXXXXXX2:          0                 
TOTAL RECORDS IN XXXXXXXXXX3:          0                 
COUNT OF RECORDS IN XXXXXXXXXX4:          0             
COUNT OF RECORDS IN XXXXXXXXXX5:          0             
TOTAL RECORDS IN XXXXXXXXXX6:          0                 
TOTAL RECORDS IN XXXXXXXXXX7:          0                 
**************************** Bottom of Data *************
Back to top
View user's profile Send private message
praveenbl22
Currently Banned

New User


Joined: 26 Sep 2007
Posts: 24
Location: Bangalore

PostPosted: Tue Dec 18, 2007 3:32 pm
Reply with quote

Hi,
I am not looking for this output. I want only two records in my output file.
Quote:

COUNT OF RECORDS IN XXXXXXXXXX4: 0
COUNT OF RECORDS IN XXXXXXXXXX5: 0

Any how I got the solution.

Code:

OUTFIL FNAMES=OUT1,                                             
      INCLUDE=(2,28,CH,EQ,C'TOTAL RECORDS IN XXXXXXXXXX4:',OR,   
               2,28,CH,EQ,C'TOTAL RECORDS IN XXXXXXXXXX5:'),     
      IFTHEN=(WHEN=INIT,                                         
              PARSE=(%00=(ENDBEFR=C':',FIXLEN=28),               
                     %01=(FIXLEN=11))),                         
      IFTHEN=(WHEN=(2,28,CH,EQ,C'TOTAL RECORDS IN XXXXXXXXXX4:'),
              BUILD=(2:CNT_MSG1,31:%01)),                       
      IFTHEN=(WHEN=(2,28,CH,EQ,C'TOTAL RECORDS IN XXXXXXXXXX5:'),
              BUILD=(2:CNT_MSG2,31:%01))                         

BUt I was thinking to achieve the results with OUTREC and the JOb was ending with Syntax error. I found some examples using the Include and the results was fine.


Thanks
Back to top
View user's profile Send private message
Agni

New User


Joined: 22 Nov 2007
Posts: 83
Location: Chennai

PostPosted: Tue Dec 18, 2007 4:26 pm
Reply with quote

Praveen,

Can you explain the following part alone (especially '%00')?

Thanks
Agni
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: Tue Dec 18, 2007 9:33 pm
Reply with quote

Praveen,

You have the right idea. However, if I understand what you're trying to do (and maybe I don't), your DFSORT job can be simplified and made more automatic as follows:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
 *************************************
 *********NOT FOUND FILE**************
 *********JOB XXXXXXXX***************
 TOTAL RECORDS IN XXXXXXXXXX1:          0
 TOTAL RECORDS IN XXXXXXXXXX2:          0
 TOTAL RECORDS IN XXXXXXXXXX3:          0
 TOTAL RECORDS IN XXXXXXXXXX4:          0
 TOTAL RECORDS IN XXXXXXXXXX5:          0
 TOTAL RECORDS IN XXXXXXXXXX6:          0
 TOTAL RECORDS IN XXXXXXXXXX7:          0
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(19,12,SS,EQ,C'XXXXXXXXXX4:,XXXXXXXXXX5:')
  INREC PARSE=(%=(ENDBEFR=C':'),
    %00=(SUBPOS=2,FIXLEN=2),
    %01=(FIXLEN=11)),
    BUILD=(2:C'COUNT OF RECORDS IN XXXXXXX',%00,%01)
/*


SORTOUT would have:

Code:

 COUNT OF RECORDS IN XXXXXXX4:          0
 COUNT OF RECORDS IN XXXXXXX5:          0
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: Tue Dec 18, 2007 9:35 pm
Reply with quote

Quote:
Can you explain the following part alone (especially '%00')?


For complete details on DFSORT's PARSE function, see:

Use [URL] BBCode for External Links
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 Store the data for fixed length COBOL Programming 1
No new posts DELETE SPUFI DB2 1
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top