Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Build Dynamic Sort output and limit ',' character

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 137

PostPosted: Sat Feb 02, 2019 4:40 am    Post subject: Build Dynamic Sort output and limit ',' character
Reply with quote

Hi Team,
I am building the Sort join card which match two input files which is of RECFM=FB and LRECL= 80 Bytes and creates the output file on Non matching records from File [F1] . This output will be used along with the SQL query with respect to condition on 'IN' Clause .

File F1 :
Code:


-----------------------------------
2018-01-19
2018-01-22
------------------------------------







File F2:-
Code:


-----------------------------------------------
2019-01-19 2018-01-20
2019-01-22 2018-01-22
-----------------------------------------------


SORT CARD:-

Code:


OPTION COPY
INREC OVERLAY=(25:C',')
JOINKEYS FILES=F1,FIELDS=(01,10,A)
JOINKEYS FILES=F2,FIELDS=(12,10,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:01,10,?)
OUTFIL FNAMES=SORTOUT,INCLUDE=(11,1,CH,EQ,C'1'),NULLOFL=RC4,
REMOVECC,
HEADER1=(10:'('),
BUILD=(11:X'7D',
             12:01,10,
             22:X'7D',
             23:25,01,80:X),
TRAILER1=(10:')')




Is there a way not to add ',' if the count is not > 1 record and format the output with ',' character accordingly

Thanks
Balaji K
Back to top
View user's profile Send private message

sergeyken

Active User


Joined: 29 Apr 2008
Posts: 471
Location: Maryland

PostPosted: Sat Feb 02, 2019 7:24 pm    Post subject:
Reply with quote

First of all, re-order your statements in the sequence they are really used by SORT utility. Otherwise it takes long time trying to understand the actual behavior of your example, and the final result. It doesn't worth to spend so much time for others to analyze any dirty code.
Code:
 JOINKEYS ...
 JOINKEYS ...
 JOIN ...
 REFORMAT ...
 INREC OVERLAY=(25:C',')
 SORT FIELDS=COPY
 OUTFIL FNAMES=SORTOUT,
        INCLUDE=(11,1,CH,EQ,C'1'),
        NULLOFL=RC4,
        REMOVECC,
        HEADER1=(10:'('),
        BUILD=(11:X'7D',
               12:01,10,
               22:X'7D',
               23:25,01,80:X),
        TRAILER1=(10:')')
 END
Back to top
View user's profile Send private message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 137

PostPosted: Mon Feb 18, 2019 9:08 am    Post subject: Reply to: Build Dynamic Sort output and limit ',' character
Reply with quote

Hi Team,
I come up with a solution to limit ',' using ICE TOOL . Here is the cntl card info
Assume that the input is of below format

Code:

IN1 DD *
'2018-01-01'
'2019-01-01'



Code:


TOOLIN DD*
DATASORT FROM(IN1) TO(OUT1) LAST USING(CTL1)

CTL1 CNTL DD *

INREC OVERLAY=(13:C',')
SORT FIELDS=(1,12,CH,A),EQUALS
SUM FIELDS=(NONE)
OUTFIL FNAMES=OUT1,REMOVECC,
HEADER1=(10:'('),
BUILD=(11:01,13,80:X),
TRAILER1=(10:')')

Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Feb 20, 2019 10:05 pm    Post subject:
Reply with quote

balaji81_k.

Or you could add a dummy value in the TRAILER1 in your original control card. REFORMAT and '?-match marker' are not needed if you are interested only in non-matching records from one of the inputs (F1 in this case).
Code:
//SYSIN    DD   *                 
 JOINKEYS FILES=F1,FIELDS=(01,10,A)
 JOINKEYS FILES=F2,FIELDS=(12,10,A)
 JOIN UNPAIRED,F1,ONLY             
 OPTION COPY                       
 OUTFIL NULLOFL=RC4,               
 REMOVECC,                         
 HEADER1=(10:'('),                 
 BUILD=(11:C'''',1,10,C''',',80:X),
 TRAILER1=(11:'''0001-01-01'')')   
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing duplicate record based on th... Nilanjan Sikdar DFSORT/ICETOOL 2 Mon Jul 22, 2019 8:29 pm
No new posts need help with a tricky sort - Continued rajiv rengasamy SYNCSORT 8 Tue Jul 16, 2019 1:26 pm
No new posts Sort records within a data block rajiv rengasamy DFSORT/ICETOOL 0 Fri Jul 12, 2019 3:25 pm
This topic is locked: you cannot edit posts or make replies. need help with a tricky sort. rajiv rengasamy SYNCSORT 7 Fri Jul 12, 2019 12:36 pm
No new posts To remove the spaces using SORT Card dharmaraok DFSORT/ICETOOL 1 Tue Apr 30, 2019 3:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us