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
 

 

Need help on splice or GROUP function

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Sun Aug 16, 2009 4:50 pm    Post subject: Need help on splice or GROUP function
Reply with quote

I have below requirement.

I have an 80 byte FB file as follows:

File a:

Code:

Matching key:(1-20) amount  date
xxxxxxxxxxxxx       123     11-dec
xxxxxxxxxxxxx       123.2   12-dec
yyyyyyyyyyyyy       124.1   11-dec
yyyyyyyyyyyyy       124     12-dec
yyyyyyyyyyyyy       126.2   12-dec
zzzzzzzzzzzzzzz     125     11-dec


If you see above file, there are duplicates found in matching for different amount and different date or same date.

I want to flattern all duplicate records into single record as follows:

Output:

Code:

Matching Key        amt1    date1   amt2   date2   amt3   date3
xxxxxxxxxxx         123     11-dec  123.2  12-dec  ----   -----
yyyyyyyyyyy         124.1   11-dec  124    12-dec  126.2  12-dec
zzzzzzzzzzzzz       125     11-dec
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: Mon Aug 17, 2009 10:30 pm    Post subject:
Reply with quote

What is the maximum number of duplicates you expect for a single key?
What is the maximum number of amt/date fields you expect in an output record? Can one key require more than one line?
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Tue Aug 18, 2009 12:51 am    Post subject: Reply to: Need help on splice or GROUP function
Reply with quote

Hi Frank,
Thanks for your reply.
Maximum duplicate could be 50.
As maximum duplicate is 50, i expect maximum 50 amount/date fields in output.
I need 1 key in single line.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Aug 18, 2009 1:21 am    Post subject: Reply to: Need help on splice or GROUP function
Reply with quote

noorkh,

It can be done with group or splice depending on your version of SORT.

Can you provide me with the following details?

1. what is the cobol layout of the input file
2. what is LRECL and recfm of the input and desired OUTPUT file?

run this job and show me the sysout which would help me determine the level of DFSORT you are running

Code:

//STEP0100 EXEC PGM=SORT   
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD *           
//SORTOUT  DD SYSOUT=*     
//SYSIN    DD *           
  SORT FIELDS=COPY         
/*                         
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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm


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