Page 1 of 2

To merge 2 records (FB,VB) into 1 record (VB)

PostPosted: Thu May 15, 2014 7:29 pm
by hariharan_bk
The requirement is -
I need to copy the 9 byte string from File1 (FB) into File 2 (VB) at the position 71.

File data and file DCb details provided below.

The 9 chars (VALUE Xs) in File 2 are the ones to be replaced by the 9 digit char from file 1.

Though i have tried many possible ways to get this done (SORT/ICETOOL), i end up in some kind of VB/FB copy related issues, thereby i will not be able to proceed further.

Could someone please help me on this.

File 1:
--------------------
**********
000000004
**********
Record format . . . : FB
Record length . . . : 9
Block size . . . . : 9

File 2:
----------------------
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
999999999999999999999999999999990000000000000000000000000000000000011GXXXXXXXXX
**************************** Bottom of Data ****************************

Record format . . . : VB
Record length . . . : 3764
Block size . . . . : 27998


Syntaxes tried:
-------------------

//IN1 DD DISP=SHR,DSN=*.EDITCNT.SORTOUT
//IN2 DD DISP=SHR,DSN=*.GETACCNT.OUT
//OUT DD DSN=&&TRLL,
// DISP=(MOD,PASS),
// SPACE=(CYL,(20,20),RLSE),
// UNIT=DISK,VOL=(,,,10)
//OUT1 DD DSN=ACCTTEST.V523241.TRLZ,
// DISP=(OLD,CATLG,CATLG),
// UNIT=SYSDA,
// SPACE=(CYL,(50,10),RLSE),
// DCB=(RECFM=VB,LRECL=3764,BLKSIZE=0)
//TOOLIN DD *
COPY FROM(IN1) TO(OUT) USING(CTL1)
COPY FROM(IN2) TO(OUT) USING(CTL2)
SPLICE FROM(OUT) TO(OUT1) ON(3765,8,PD) WITH(71,3690) USING(CTL3)
/*
//CTL1CNTL DD *
INREC BUILD=(1,4,5:5,3760,3765:SEQNUM,8,PD)
OUTFIL FNAMES=OUT
/*

ERROR:
WER108I IN1 : RECFM=VB ; LRECL= 3764; BLKSIZE= 27998
WER073I IN1 : DSNAME=ACCTTEST.V523241.TRLA
WER257I INREC RECORD LENGTH = 3772
WER238I POTENTIALLY INEFFICIENT USE OF INREC
WER110I OUT : RECFM=VB ; LRECL= 3772; BLKSIZE= 27998
WER074I OUT : DSNAME=SYS14135.T091821.RA000.UIMEXTRT.TRLL.H01
WER552I THIS COPY STEP COULD RUN WITH SIGNIFICANTLY LESS CPU AND ELAPSED TIME
WER410B 5,868K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 2,247,180 BYTES USED
WER244A INREC - SHORT RECORD

-------------------------------------------------------------------------------------------------------------------------------------------

//TOOLIN DD *
COPY FROM(IN1) TO(OUT) USING(CTL1)
COPY FROM(IN2) TO(OUT) USING(CTL2)
SPLICE FROM(OUT) TO(OUT1) ON(3765,8,PD) WITH(71,3690) USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(5,3760,3772:X)
OUTREC BUILD=(1,4,5:5,3760,3765:SEQNUM,8,PD)
OPTION VLSHRT
/*

Issue:
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I IN1 : RECFM=VB ; LRECL= 3764; BLKSIZE= 27998
WER073I IN1 : DSNAME=ACCTTEST.V523241.TRLA
WER237I OUTREC RECORD LENGTH = 3772
WER110I OUT : RECFM=VB ; LRECL= 3772; BLKSIZE= 27998
WER074I OUT : DSNAME=SYS14135.T085918.RA000.UIMEXTRT.TRLL.H01
WER552I THIS COPY STEP COULD RUN WITH SIGNIFICANTLY LESS CPU AND ELAPSED TIME
WER410B 5,868K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 2,243,312 BYTES USED
WER244A OUTREC - SHORT RECORD
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000

------------------------------------------------------------------------------------------------------------------------------

Re: DFSORT/ICETOOL to merge 2 records (FB,VB) into 1 record

PostPosted: Thu May 15, 2014 7:53 pm
by enrico-sorichetti
the WER prefix tells that You are using SYNCSORT not DFSORT/ICETOOL
You should have noticed that there is a forum section for it,

most IBM competitors to ease the migration to their product
define the IBM modules names as ALIASES to their own so to avoid mass Jcl changes

also when You post code/jcl snippets it is a good habit to use the code tags
the make jcl much easier to read and - MOST IMPORTANT - they preserve the spaces

just an example
//IN1 DD DISP=SHR,DSN=*.EDITCNT.SORTOUT
//IN2 DD DISP=SHR,DSN=*.GETACCNT.OUT
//OUT DD DSN=&&TRLL,
// DISP=(MOD,PASS),
// SPACE=(CYL,(20,20),RLSE),
// UNIT=DISK,VOL=(,,,10)

Re: DFSORT/ICETOOL to merge 2 records (FB,VB) into 1 record

PostPosted: Thu May 15, 2014 8:26 pm
by hariharan_bk
I have used ICETOOL only.

Please find the code snippet from the JCL:

Please let me know if any more info is required. Could you pls help me get the issue resolved.

/EXTEEE EXEC  PGM=ICETOOL   
/TOOLMSG DD SYSOUT=*       
/DFSMSG  DD SYSOUT=*       
//IN1    DD DISP=SHR,DSN=*.EDITCNT.SORTOUT                         
//IN2    DD DISP=SHR,DSN=*.GETACCNT.OUT                             
//OUT    DD DSN=&&TRLL,                                             
//             DISP=(MOD,PASS),                                     
//             SPACE=(CYL,(20,20),RLSE),                           
//             UNIT=DISK,VOL=(,,,10)                               
//OUT1   DD DSN=ACCTTEST.V523241.TRLZ,                             
//             DISP=(OLD,CATLG,CATLG),                             
//             UNIT=SYSDA,                                         
//             SPACE=(CYL,(50,10),RLSE),                           
//             DCB=(RECFM=VB,LRECL=3764,BLKSIZE=0)                 
//TOOLIN DD *                                                       
  COPY FROM(IN1) TO(OUT) USING(CTL1)                               
  COPY FROM(IN2) TO(OUT) USING(CTL2)                               
  SPLICE FROM(OUT) TO(OUT1) ON(3765,8,PD) WITH(71,3690) USING(CTL3)
/*                                                                 
//CTL1CNTL DD *                                                     
  INREC BUILD=(1,4,5:5,3760,3765:SEQNUM,8,PD)                       
  OUTFIL FNAMES=OUT                                                 
/*

Re: DFSORT/ICETOOL to merge 2 records (FB,VB) into 1 record

PostPosted: Thu May 15, 2014 9:18 pm
by BillyBoyo
How many records do you have on each file?

Re: To merge 2 records (FB,VB) into 1 record (VB)

PostPosted: Thu May 15, 2014 11:29 pm
by dick scherrer
Hello,

I have used ICETOOL only.
Which gives no information about which product is used.

If you look at the sysout messages, you will see that you are using the code from Syncsort.

Re: To merge 2 records (FB,VB) into 1 record (VB)

PostPosted: Thu May 15, 2014 11:31 pm
by dick scherrer
Add on:

What do you want help with?

Re: To merge 2 records (FB,VB) into 1 record (VB)

PostPosted: Thu May 15, 2014 11:45 pm
by hariharan_bk
File 1 has one record of length 9 bytes. Format is FB.
File 2 has one variable block record of Max length 3764.

I want to replace the chars in file 2 at position 71 by the 9 byte string from file 1.... This is the req.
Pls help

Re: To merge 2 records (FB,VB) into 1 record (VB)

PostPosted: Fri May 16, 2014 12:22 am
by dick scherrer
Hello,

You have described no requirement . . . All I see is something about using the data from pos 1 to be stored in pos 71 of the other file.

You have not described the "rules". What about duplicates in one file or the other?

Keep in mind that you know just what you want. We have no idea as we do not know your system, let alone this particular requirement.

Re: To merge 2 records (FB,VB) into 1 record (VB)

PostPosted: Fri May 16, 2014 12:46 am
by hariharan_bk
At any point there will be only one record in each of the 2 files. So no dups. Both records in the two files are kind of trailer records having count values. Here I m just trying to merge these two records into single trailer record.

Re: To merge 2 records (FB,VB) into 1 record (VB)

PostPosted: Fri May 16, 2014 12:51 am
by enrico-sorichetti
from the scarce info of the TS file 1 contains just ONE record with the strand to overlay

I would go for a two pass solution ( simpler to understand )
step1 to build the SORT copy/OVERLAY
step 2 to run the above

here a sample ( modify according to Your needs )

 ****** ***************************** Top of Data ******************************
 - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  3 Line(s) not Displayed
 000004 //S1      EXEC PGM=SORT
 000005 //SYSPRINT  DD SYSOUT=*
 000006 //SYSOUT    DD SYSOUT=*
 000007 //SORTIN    DD *
 000008 123456789
 000009 //SORTOUT   DD DISP=(,PASS),DSN=&&SYSIN,
 000010 //             UNIT=SYSDA,SPACE=(CYL,(1,1)),
 000011 //             DCB=(RECFM=FB,LRECL=80)
 000012 //SYSIN     DD *
 000013   OPTION COPY
 000014   OUTFIL BUILD=(C'  SORT FIELDS=COPY',80:X,/,
 000015                 C'  INREC  OVERLAY=(11:C''',1,9,C''')',80:X)
 000016 //S2      EXEC PGM=SORT
 000017 //SYSPRINT  DD SYSOUT=*
 000018 //SYSOUT    DD SYSOUT=*
 000019 //SORTIN    DD *
 000020 AAAAAAAAAAAAAAAAAAAAAAAAAAA
 000021 BBBBBBBBBBBBBBBBBBBBBBBBBBB
 000022 //SORTOUT   DD SYSOUT=*
 000023 //SYSIN     DD DISP=(OLD,PASS),DSN=&&SYSIN
 ****** **************************** Bottom of Data ****************************


the result
********************************* TOP OF DATA **********************************
AAAAAAAAAA123456789AAAAAAAA
BBBBBBBBBB123456789BBBBBBBB
******************************** BOTTOM OF DATA ********************************