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
 

 

DFSORT-Delete and Overide the Data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: DFSORT-Delete and Overide the Data
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: 1439
Location: Bangalore,India

PostPosted: Tue Dec 18, 2007 2:54 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: DFSORT-Delete and Overide the Data
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 Moderator


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

PostPosted: Tue Dec 18, 2007 9:33 pm    Post subject:
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 Moderator


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

PostPosted: Tue Dec 18, 2007 9:35 pm    Post subject:
Reply with quote

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


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

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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