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

Need help on splice or GROUP function


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Aug 17, 2009 10:30 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
Search our Forums:

Back to Top