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
 

 

Sorting to get only one type of error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sorting to get only one type of error
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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Mar 08, 2011 9:28 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Sorting to get only one type of error
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    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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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