IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

JOINKEYS Paired and Unpaired Sort on VB Input


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

New User


Joined: 21 May 2009
Posts: 5
Location: Philadelphia

PostPosted: Tue Nov 07, 2017 2:46 am
Reply with quote

Hello,

The following sort of two fixed width files creates three output files; one with paired file1/file2 records, one with unpaired file1 records, and one with unpaired file2 records. This uses what is known as the "indicator method":

Code:

//JKE5  EXEC  PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                           
//SORTJNF1 DD DSN=TCK401.INPUT1,DISP=SHR                         
//SORTJNF2 DD DSN=TCK401.INPUT2,DISP=SHR                         
//YESONLY  DD DSN=TCK401.MAS.YESONLY,                           
//            UNIT=(SYSDA,4),SPACE=(CYL,(100,60),RLSE),         
//            DISP=(NEW,CATLG,CATLG),                           
//            DCB=(RECFM=FB,LRECL=4235,BLKSIZE=0)               
//TODONLY DD DSN=TCK401.MAS.TODONLY,                             
//            UNIT=(SYSDA,4),SPACE=(CYL,(100,60),RLSE),         
//            DISP=(NEW,CATLG,CATLG),                           
//            DCB=(RECFM=FB,LRECL=4235,BLKSIZE=0)               
//BOTH DD DSN=TCK401.MAS.BOTH,                                   
//            UNIT=(SYSDA,4),SPACE=(CYL,(100,60),RLSE),         
//            DISP=(NEW,CATLG,CATLG),                           
//            DCB=(RECFM=FB,LRECL=4235,BLKSIZE=0)               
//SYSIN DD *                                                     
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION                   
  JOINKEYS FILE=F1,FIELDS=(1,80,A),SORTED,NOSEQCK               
  JOINKEYS FILE=F2,FIELDS=(1,80,A),SORTED,NOSEQCK               
  JOIN UNPAIRED,F1,F2                                           
  REFORMAT FIELDS=(F1:1,4235,F2:1,4235,?)                       
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)             
  OPTION COPY                                                   
  OUTFIL FNAMES=YESONLY,INCLUDE=(8471,1,CH,EQ,C'1'),             
    BUILD=(1,4235)                                               
  OUTFIL FNAMES=TODONLY,INCLUDE=(8471,1,CH,EQ,C'2'),             
    BUILD=(4236,4235)                                           
  OUTFIL FNAMES=BOTH,INCLUDE=(8471,1,CH,EQ,C'B'),               
    BUILD=(1,4235,/,4236,4235)                                   
/*                                                               


My problem now is that the input files have changed to variably blocked. Does anyone know how to convert this sort so that it will work with VB input/output files? Or is there a different sorting method that could be used to produce the same output files (now VB)? The input file keys are still the same. Thank you so much in advance for any help with this.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 879
Location: Maryland

PostPosted: Tue Nov 07, 2017 2:51 am
Reply with quote

MFwhiz wrote:
My problem now is that the input files have changed to variably blocked. Does anyone know how to convert this sort so that it will work with VB input/output files? Or is there a different sorting method that could be used to produce the same output files (now VB)? The input file keys are still the same. Thank you so much in advance for any help with this.

Based on questions like this one, it looks like the code you submitted has not been written by yourself, but copy-pasted (e.g. "stolen") in full from another person/forum/site. Isn't it?
Back to top
View user's profile Send private message
MFwhiz

New User


Joined: 21 May 2009
Posts: 5
Location: Philadelphia

PostPosted: Tue Nov 07, 2017 7:23 pm
Reply with quote

The code originally came from the IBM knowledge center:

LINK

So yes, I have stolen it from there icon_smile.gif

Is there another sort method I should use or should I just write a program?
Back to top
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 40
Location: NY

PostPosted: Tue Nov 07, 2017 8:33 pm
Reply with quote

MFwhiz wrote:
The code originally came from the IBM knowledge center:

LINK

So yes, I have stolen it from there icon_smile.gif

Is there another sort method I should use or should I just write a program?



... If only there were a z/OS VxRx.x DFSORT Application Programming Guide freely available on the IBM website that might provide the answer ...
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10697
Location: italy

PostPosted: Tue Nov 07, 2017 8:46 pm
Reply with quote

Quote:
... If only there were a z/OS VxRx.x DFSORT Application Programming Guide freely available on the IBM website that might provide the answer ...



googling with DFSORT Application Programming Guide returned
Use [URL] BBCode for Links

worth also googling with Smart DFSORT Tricks
Use [URL] BBCode for Links
old but still pretty useful
Back to top
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 40
Location: NY

PostPosted: Tue Nov 07, 2017 8:53 pm
Reply with quote

enrico-sorichetti wrote:
Quote:
... If only there were a z/OS VxRx.x DFSORT Application Programming Guide freely available on the IBM website that might provide the answer ...



googling with DFSORT Application Programming Guide returned
Use [URL] BBCode for Links

worth also googling with Smart DFSORT Tricks
Use [URL] BBCode for Links
old but still pretty useful



icon_smile.gif ........ The LINK that the poster included in their post is to the online DFSORT Application Programming Guide....
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10697
Location: italy

PostPosted: Tue Nov 07, 2017 8:55 pm
Reply with quote

for some odd reason I received an invalid url response
Back to top
View user's profile Send private message
MFwhiz

New User


Joined: 21 May 2009
Posts: 5
Location: Philadelphia

PostPosted: Fri Nov 10, 2017 7:26 pm
Reply with quote

The "Smart DFSORT Tricks" PDF had exactly what I needed. I hadn't seen that before. Thanks John Del and enrico-sorichetti!
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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts JOINKEYS to match two input files on ... DFSORT/ICETOOL 3
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
No new posts Copying data from prev record using SORT SYNCSORT 19
No new posts Combining more 4 files with sorted or... DFSORT/ICETOOL 3
No new posts Creating a single-record file with CO... DFSORT/ICETOOL 8

Back to Top