View previous topic :: View next topic
|
Author |
Message |
abdulrafi
Active User
Joined: 14 Sep 2009 Posts: 184 Location: Coimbatore
|
|
|
|
Hi,
I do have a doubt in JCL. I go the below input file using joinkeys logic. Now I have a problem in bringing them in same line.
Input File:
-------------
20191021
20191022
Expected Output file:
-----------------------
20191021 20191022
Can you please let me know how to bring it same line. I tried ICETOOL but could not get the correct logic. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2018 Location: USA
|
|
|
|
abdulrafi wrote: |
Hi,
I do have a doubt in JCL. I go the below input file using joinkeys logic. Now I have a problem in bringing them in same line.
Input File:
-------------
20191021
20191022
Expected Output file:
-----------------------
20191021 20191022
Can you please let me know how to bring it same line. I tried ICETOOL but could not get the correct logic. |
Your problem has nothing to do with JCL.
Try to understand the issue a little bit better.
Unless you presented an example of your code nobody here would even understand your problems, to say nothing about providing you with some help. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2018 Location: USA
|
|
|
|
abdulrafi wrote: |
Hi,
I do have a doubt in JCL. I go the below input file using joinkeys logic. Now I have a problem in bringing them in same line.
Input File:
-------------
20191021
20191022
Expected Output file:
-----------------------
20191021 20191022
Can you please let me know how to bring it same line. I tried ICETOOL but could not get the correct logic. |
Besides of all, what are you "joining" in this example???????
The values "20191021" and "20191022" cannot be joined normally (e.g. as INNER JOIN). They can be joined as FULL OUTER JOIN, but it would work only for one single pair; in that case it would be much-much easier to do this manually, by hand, using paper and ink instead of any DFSORT, and even without computer!!! |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
There are many ways to combine 2 or more records into 1. You can try IFTHEN=(WHEN=GROUP=.... ,SPLICE or RESIZE ( most simple one).
RESIZE operator |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2018 Location: USA
|
|
|
|
Rohit Umarjikar wrote: |
There are many ways to combine 2 or more records into 1. You can try IFTHEN=(WHEN=GROUP=.... ,SPLICE or RESIZE ( most simple one).
RESIZE operator |
1) In this case it would be not JOIN/JOINKEYS operation, but instead - virtual APPEND/CONCAT. This is the first thing the TS must understand the difference between.
2) I doubt it is possible to use WHEN=GROUP in that case, at least without sophisticated tricks. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Quote: |
2) I doubt it is possible to use WHEN=GROUP in that case, at least without sophisticated tricks.
|
Something like this...
Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTLIST DD SYSOUT=*
//SORTIN DD *
20191016
20191015
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(71:1,8,81:SEQ=1))
OUTFIL INCLUDE=(81,1,ZD,EQ,2),BUILD=(71,8,X,1,8) |
Output
|
|
Back to top |
|
|
|