|
View previous topic :: View next topic
|
| Author |
Message |
naveensrimf
New User
Joined: 04 Oct 2005 Posts: 34
|
|
| Back to top |
|
 |
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
Please send the requirements document and someone here will do the coding/testing for you.
Also, we'll let your boss know Not to bother you with such tasks and directly post on this forum.
. |
|
| Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
First Please take a few minutes to review your post before submit....
It is as if you are asking someone to do it here .. I find it rude at least...
To answer your question:
1. Your need to use ICETOOL for multiple passes along with joinkeys
2. First pass you need to prepare for //JNF1CNTL where JNF1CNTL should have your key and nth SEQUENCE number for each group (Ex: 145678 and 4 ) You need to do that using INREC + Adding SEQUNCE NUMBER + SORT descending based on Sequence number and SELECT first and assign to a temp file which would serve as you JNF1CNTL
3.Assign your original file for JNF2CNTL
4.Inrec add a sequnce to your original file
5.join both files based on client number
6. Reformat
7.When Sequence number matches from both the files dont add ',' else add |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
Or you could do something like this by joining the same input to itself, which does not involve SORTing. I have assumed the input attributes to be FB/LRECL-80.
You could modify it as per your actual requirement.
| Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
20180720 XYZCOMPANY 145678 [email protected]
20180721 XYZCOMPANY 145678 [email protected]
20180722 XYZCOMPANY 145678 [email protected]
20180723 XYZCOMPANY 145678 [email protected]
20180720 XYZCOMPANY 145685 [email protected]
20180721 XYZCOMPANY 145685 [email protected]
20180722 XYZCOMPANY 145687 [email protected]
20180723 XYZCOMPANY 145688 [email protected]
//SORTJNF2 DD *
20180720 XYZCOMPANY 145678 [email protected]
20180721 XYZCOMPANY 145678 [email protected]
20180722 XYZCOMPANY 145678 [email protected]
20180723 XYZCOMPANY 145678 [email protected]
20180720 XYZCOMPANY 145685 [email protected]
20180721 XYZCOMPANY 145685 [email protected]
20180722 XYZCOMPANY 145687 [email protected]
20180723 XYZCOMPANY 145688 [email protected]
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(81,8,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(81,8,A),SORTED,NOSEQCK
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,80,F2:21,6,?)
SORT FIELDS=COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=(21,6,CH,EQ,81,6,CH),OVERLAY=(41:C','))
//JNF1CNTL DD *
INREC OVERLAY=(81:SEQNUM,8,ZD)
//JNF2CNTL DD *
INREC OVERLAY=(81:SEQNUM,8,ZD,START=0) |
SORTOUT had:
|
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
After 13 years as a member of the forum you should know to use the code-tags when postings code, data, screenshots etc.
Also after so long in the industry you should know the difference between a data set and a file. |
|
| Back to top |
|
 |
naveensrimf
New User
Joined: 04 Oct 2005 Posts: 34
|
|
|
|
| Thanks for the solution. Now my requirement is full filled. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
If you don't care about the sort order then try below solution as well else add one more step to SORT it back to original order. If the records are more like in millions then probably this is not the right way to do it.
| Code: |
//STEP010 EXEC PGM=SORT
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD *
20180720 XYZCOMPANY 145678 [email protected]
20180721 XYZCOMPANY 145678 [email protected]
20180722 XYZCOMPANY 145678 [email protected]
20180723 XYZCOMPANY 145678 [email protected]
20180720 XYZCOMPANY 145685 [email protected]
20180721 XYZCOMPANY 145685 [email protected]
20180722 XYZCOMPANY 145687 [email protected]
20180723 XYZCOMPANY 145688 [email protected]
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(21,6,CH,A,50,2,ZD,D)
INREC OVERLAY=(50:SEQNUM,2,ZD,RESTART=(21,6),41:C',')
OUTREC OVERLAY=(60:SEQNUM,2,ZD,RESTART=(21,6))
OUTFIL IFOUTLEN=41,
IFTHEN=(WHEN=(60,2,ZD,EQ,1),OVERLAY=(41:C' ')) |
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|