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

Query on JCL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 184
Location: Coimbatore

PostPosted: Wed Oct 16, 2019 7:02 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Wed Oct 16, 2019 7:07 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Wed Oct 16, 2019 7:28 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Oct 16, 2019 7:49 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Wed Oct 16, 2019 8:35 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Oct 16, 2019 10:09 pm
Reply with quote

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
Code:
20191016 20191015
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 RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top