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

Joinkeys operation betwen VB and FB file


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Susanta

Active User


Joined: 17 Nov 2009
Posts: 126
Location: India

PostPosted: Sun Sep 25, 2016 9:49 pm
Reply with quote

Hi...

Facing issue with joinkey operation for F1 (VB file with len 80) and F2 (FB file of len 55) , when F1s 1,14 mathces with F2s 2,14 then write F2s 16,14 and f1s 15 to end of record to F1only file. (In case no match then write complete F1 record to F1ONLY.)

Output file F1ONLY need to be of lrecl and format same as F1 file.

In this same step JNF1CNTL is used to add SEQNUM of 10 bytes to F1 file
XXX.XXXX.XXXXX.XXXX.VB.V1

The card is ..

Code:
   INREC FIELDS=(1:1,4,5:SEQNUM,10,ZD,15:5,76)   



Job gives abend..
IEF450I TXXXYY03 PS080 JS010 - ABEND=S000 U0016 REASON=00000000


The card details from sysout..

Code:

 

SYNCSORT FOR Z/OS  2.1.1.1R    U.S. PATENTS: 4210961, 5117495   (C) 2014 SYNCSO
                                                       z/OS   2.1.0             
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 19D64, MODEL 2827 718             LICEN
 SYSIN :                                                                       
  JOINKEYS FILE=F1,FIELDS=(15,14,CH,A)                                         
  JOINKEYS FILE=F2,FIELDS=(2,14,CH,A)                                           
  JOIN UNPAIRED,F1                                                             
  REFORMAT FIELDS=(F1:1,4,5,86,F2:1,55),FILL=C'$'                               
  SORT FIELDS=(5,10,ZD,A)                                                       
                                                                                 
  OUTFIL FNAMES=F1ONLY,IFOUTLEN=80,                                             
  IFTHEN=(WHEN=(5,1,CH,NE,C'$',AND,91,1,CH,EQ,C'$'),                           
         BUILD=(1,4,15,76)),                                                   
  IFTHEN=(WHEN=(5,1,CH,NE,C'$',AND,91,1,CH,NE,C'$'),                           
         BUILD=(1,4,106,14,29,62))                                             
 WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED                 
 WER164B  17,736K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,           
 WER164B     0 BYTES RESERVE REQUESTED, 416K BYTES USED                         
 WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                               
 WER481I  JOINKEYS REFORMAT RECORD LENGTH=  145, TYPE = F                       
 WER202A  F1ONLY   RECFM INCOMPATIBLE                                           
 WER110I  F1ONLY   : RECFM=VB   ; LRECL=    80; BLKSIZE=                       
 WER074I  F1ONLY   : DSNAME=TXX.XX.XXXXX.TEST.VB.V2                       
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
 WER482I  JNF1 STATISTICS                                                       
 WER483B  1,956K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,             
 WER483B     0 BYTES RESERVE REQUESTED, 476K BYTES USED                         
 WER108I  SORTJNF1 : RECFM=VB   ; LRECL=    80; BLKSIZE= 27998                 
 WER073I  SORTJNF1 : DSNAME=XXX.XXXX.XXXXX.XXXX.VB.V1                       
 WER482I  JNF2 STATISTICS                                                       
 WER483B  1,956K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,             
 WER483B     0 BYTES RESERVE REQUESTED, 476K BYTES USED                         
 WER108I  SORTJNF2 : RECFM=FB   ; LRECL=    55; BLKSIZE=  5500                 
 WER073I  SORTJNF2 : DSNAME=TXX.XX.XREF.FILE


Could you please help.

Thanks
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Sep 25, 2016 10:51 pm
Reply with quote

You have SYNCSORT FOR Z/OS 2.1.1.1R (MFX, which it has been officially for a while). This supports the Match Marker, "?", in the REFORMAT statement and it is much easier to use that that to mess with FILL.

Your F1 input is variable-length.

Your F2 input is fixed-length.

This gives you the choice of a variable- or fixed-length REFORMAT. You choose which best matches your output.

Your output is to be the same length and format as your F1. So making your REFORMAT variable-length is the easiest.

You do this by having, in the first four bytes of the REFORMAT, an RDW from a variable-length input file.

Code:
 REFORMAT FIELDS=(F1:1,4,


Then you need all your data from F1, as you may need it:

Code:
 REFORMAT FIELDS=(F1:1,4,5


That says "from position 5 until the end of the current record". But, you also want some fixed-length data from F2, which it is best to put before the variable-length data (rather than pad the variable-length data and VLTRIM it later).
Code:

 REFORMAT FIELDS=(F1:1,4,F2:1,55,F1:5


But then why do you need 55 bytes from F2 if you only use 14 of them?

Code:
 REFORMAT FIELDS=(F1:1,4,F2:16,14,F1:5


And the match-marker
Code:

 REFORMAT FIELDS=(F1:1,4,F2:16,14,?,F1:5)


Then, change your SORT, as the sequence number position has changed on the REFORMAT record.

Then, why is your OUTFIL called F1ONLY? That is confusing.

Forget the IFOUTLEN, you want variable-length records.

Code:
   OUTFIL FNAMES=someusefulname,                         
         IFTHEN=(WHEN=(19,1,CH,EQ,C'1'),                           
                       BUILD=(1,4,26)),                                                   
         IFTHEN=(WHEN=NONE,                           
                      BUILD=(1,4,5,14,positionoftheF1fromREFORMATthatyouwabn)) 


That final position-without-lenght will again say "from this position to the end of the current (REFORMAT) record".

If you try that, you'll also get a good idea why it is more beneficial to tell you all this than to directly tell you what to untangle from what you had.

Once you understand the above, you should be able to understand where you were going wrong previously.
Back to top
View user's profile Send private message
Susanta

Active User


Joined: 17 Nov 2009
Posts: 126
Location: India

PostPosted: Mon Sep 26, 2016 11:47 am
Reply with quote

Thanks Bill for your suggestions, I am working on it, having a doubt..

what does when None means , does it mean match found. it seems so by seeing the build card.
Also does it always return 1 as the marker value when no match found.

Thanks
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Sep 26, 2016 2:09 pm
Reply with quote

The match-marker can have B, 1 or 2. Where B means "on both". WHEN=NONE means when no conditions are true, like an ELSE in this situation or OTHER on EVALUATE when multiple conditions. Assuming you know COBOL.

The NONE should be in your SyncSORT documentation, the match-marker probably not.
Back to top
View user's profile Send private message
Susanta

Active User


Joined: 17 Nov 2009
Posts: 126
Location: India

PostPosted: Mon Sep 26, 2016 2:46 pm
Reply with quote

Thanks , Now i understand this, and its working now.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top