View previous topic :: View next topic
|
Author |
Message |
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
HI
I have an requirement ,where the 2 input file needs to be merged based on matching key
here key is V00034D20110701
my requirement is to merge the file 1 records into one row and file2 records in 2nd row if key matches.
FILE 1
V00034D20110701 0450
V00034D20110701 0451
V00034D20110701 0452
V00034D20110701 0456
V00034D20110701 0459
FILE2
V00034D20110701 0092T
V00034D20110701 0095T
V00034D20110701 0098T
V00034D20110701 0157T
V00034D20110701 0158T
The output should be like
V00034D20110701 01 0450 0452 0456 0459
V00034D20110701 02 0092T 0095T 0098T 0157T 0158T
The row no should be printed to for each row as shown 01 02 (middle column) |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Please run this step
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
/* |
and copy us the SYSOUT message which will help all in knowing your sort product and function level
Also where did 451 flew away from file1?
How much records do you expect for each keys ? |
|
Back to top |
|
|
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
I got below in my sysout.
Code: |
SYSIN :
OPTION COPY 0004000
WER276B SYSDIAG= 10215492, 11977331, 11977331, 1752900
WER164B 6,904K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 272K BYTES USED
WER146B 12K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER410B 5,876K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 156K BYTES USED
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B BSAM WAS USED FOR SORTIN
WER416B BSAM WAS USED FOR SORTOUT
WER054I RCD IN 1, OUT 1
WER169I RELEASE 1.3 BATCH 0506 TPF LEVEL 2.2
|
I mistakenly removed the 451. it should be present.
Maxium of 500 records can be expected for eack keys.
The output should like
Code: |
V00034D20110701 01 0450 0451 0452 0456 0459 .
V00034D20110701 02 0092T 0095T 0098T 0157T 0158T |
Code'd |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
janmejay
You have SYNCSORT so should be posted on JCL forum as this forum is for DFSORT questions only you might need to think of solution in "SPLICE" but gonna be tiresome for 500 records ;) |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
You might want to write some code to do this sort of thing. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
But again to understand TS why do you need this to be done and did you trouble your boss for lack of work ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you search in the forums, this has been "solved" a few times. Keep in mind that Much of the DFSORT control statements work with Syncsort. . .
Quote: |
I got below in my sysout. |
But you did not post the putput form the sort process provided. . . In the sysout you posted, you left out the version/release information. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi dick,
But combining 500 records into one, wont it be too much of control statements... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Arun,
I don't know - i remember the question before, but not the syntax of the solution(s).
If i wanted to do something like this, i'd probably write a bit of code as in code it is rather trivial to do. . .
Maybe someone will have a sort solution that would not take so many control statements. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi dick,
Here is a similar one, this might help to format one file by squeezing the multiple records having same key value into a single one. There the max number of occurrences was just 25.
ibmmainframes.com/viewtopic.php?p=312247&highlight=#312247
I totally agree with writing code for this, unless someone else has a Syncsort not exceeding too many lines. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Yes totally agree with Arun
Much simpler in Cobol using arrays just populate and write |
|
Back to top |
|
|
|