MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DFSORT to extract group of recrods as for the detail rec amt

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
rama krishna reddy
Beginner


Joined: 18 Sep 2006
Posts: 31
Topics: 13
Location: Hyderabad

PostPosted: Thu Sep 10, 2015 8:53 pm    Post subject: DFSORT to extract group of recrods as for the detail rec amt Reply with quote

Hi Team,

I need dfsort solution to extract only group with fee amount is greater than zero

ALL FN20 RECORDS HAVING FEE WILL HAVE SUBCAT VALUE AND FEE VALUE

if there is any fn20 with out fee then it will not have subcat and fee amount

input report file length 134

Code:


           UID            ACTNO        DESC
11FN20 99887766   12345678    NORAMAL
                                               TRAILRDESC     SUBCAT:03/09  FEE:5
                                                ATM FEE
                                                INSTERNATI     SUBCAT:04/06  FEE : 6
                                                FEE

11FN20  88888888   23456789     SPECIAL 
                                                 ATM


o/p file
Code:

          UID            ACTNO        DESC
11FN20 99887766   12345678    NORAMAL
                                               TRAILRDESC     SUBCAT:03/09  FEE:5
                                                ATM FEE
                                                INSTERNATI     SUBCAT:04/06  FEE : 6
                                                FEE


Thanks
rama krishna
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Fri Sep 11, 2015 4:22 am    Post subject: Reply with quote

Please use the Code tags to preserve spacing.

Does the FN20 itself indicate that there is a fee (NORAMAL)? Or is the first opportunity the SUBCAT?

What is the LRECL and FM of the dataset?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Fri Sep 11, 2015 10:14 am    Post subject: Reply with quote

rama krishna reddy,

You have been a member of this board for about 9 years and yet you are not following the rules.

I added the code tags for your post and see how easy it is to read. Next time learn how to use code tags.

Either way here is a JCL which will give you the desired results. I assumed you want to pick all the groups of records that have the word "FEE" anywhere in the 134 bytes.

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//INA      DD DISP=SHR,DSN=Your input FB 134 byte report file
//INB      DD DISP=SHR,DSN=Same input FB 134 byte file
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  JOINKEYS F1=INA,FIELDS=(135,9,A),SORTED,NOSEQCK               
  JOINKEYS F2=INB,FIELDS=(135,9,A),SORTED,NOSEQCK               
  REFORMAT FIELDS=(F1:1,135)                                     
//*                                                             
//JNF1CNTL DD *                                                 
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(3,4,CH,EQ,C'FN20'),           
  PUSH=(135:ID=8)),                                             
  IFTHEN=(WHEN=INIT,OVERLAY=(143:C'Y'))         
//*                 
//JNF2CNTL DD *                                                 
  INREC IFOUTLEN=143,                                           
  IFTHEN=(WHEN=GROUP,BEGIN=(3,4,CH,EQ,C'FN20'),PUSH=(135:ID=8)),
  IFTHEN=(WHEN=(1,134,SS,EQ,C'FEE'),                             
  OVERLAY=(144:SEQNUM,3,ZD,RESTART=(135,8)),HIT=NEXT),           
  IFTHEN=(WHEN=(144,3,ZD,EQ,1),OVERLAY=(143:C'Y'))               
//*

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rama krishna reddy
Beginner


Joined: 18 Sep 2006
Posts: 31
Topics: 13
Location: Hyderabad

PostPosted: Mon Sep 14, 2015 8:45 pm    Post subject: Reply with quote

thanks kolusu the sort job is working for my requirement
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group