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

Sorting to get only one type of error


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

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Tue Mar 08, 2011 8:45 pm
Reply with quote

Hi All,

I am trying to generate a list where the key is having only one type of error. which is Error1 in below example

For example
Code:

AAAAA                  Error1
AAAAA                  Error1
AAAAA                  Error1
AAAAA                  Error2
AAAAA                  Error2
AAAAA                  Error3
AAAAA                  Error3
BBBBB                  Error1
BBBBB                  Error1
BBBBB                  Error1
CCCCC                  Error2



Output should be
BBBBB Error1

Error can be duplicates for each key.RECFM=FB

Is this possible using sort?

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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Mar 08, 2011 9:28 pm
Reply with quote

Quote:
Output should be
BBBBB Error1

Error can be duplicates for each key.RECFM=FB


Your requirements are not very clear.

Do you want all records that have Error1, just ones with BBBBB, the first with BBBBB, the last with BBBBB or something else? What are the positions of the fields? What is the LRECL?

Which SORT product are you using - DFSORT or SYNCSORT?

Garry.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Tue Mar 08, 2011 9:35 pm
Reply with quote

Records which only have Error1 not any other error.
LRECL is 160.
Key is at 41 position of 10 bytes and Error is at postion 10 of 8 bytes.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Mar 08, 2011 11:02 pm
Reply with quote

rgupta71,

Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=Your input Fb 160 byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(161:C'000')),                       
  IFTHEN=(WHEN=GROUP,KEYBEGIN=(41,10),PUSH=(164:10,8)),               
  IFTHEN=(WHEN=(10,8,CH,NE,164,8,CH),OVERLAY=(163:C'1'))               
  SORT FIELDS=(41,10,CH,A),EQUALS                                     
  SUM FIELDS=(161,3,ZD)                                               
  OUTFIL BUILD=(1,160),INCLUDE=(161,3,ZD,EQ,0,AND,10,8,CH,EQ,C'ERROR1')
//*
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Tue Mar 08, 2011 11:51 pm
Reply with quote

I am getting below error.

Code:
 IFTHEN=(WHEN=GROUP,KEYBEGIN=(41,10)
                    $               
OPERAND DEFINER ERROR   
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Mar 09, 2011 12:03 am
Reply with quote

rgupta71,

Looks like your shop does not have the ptf which supports KEYBEGIN parm. Ask your System Programmer to install it (it's free). Use the following Control cards.

Code:

//SYSIN    DD *                                                         
  INREC IFTHEN=(WHEN=INIT,                                             
        OVERLAY=(161:3C'0',SEQNUM,3,ZD,RESTART=(41,10))),               
  IFTHEN=(WHEN=GROUP,BEGIN=(164,3,ZD,EQ,1),PUSH=(167:10,8)),           
  IFTHEN=(WHEN=(10,8,CH,NE,167,8,CH),OVERLAY=(163:C'1'))               
  SORT FIELDS=(41,10,CH,A),EQUALS                                       
  SUM FIELDS=(161,3,ZD)                                                 
  OUTFIL BUILD=(1,160),INCLUDE=(161,3,ZD,EQ,0,AND,10,8,CH,EQ,C'ERROR1')
//*
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 Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top