Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 998
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 1 Mon Sep 18, 2017 4:31 pm
No new posts Setting Font Type for XMIT satish.ms10 All Other Mainframe Topics 3 Fri Sep 15, 2017 10:01 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us