MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SPLICE with VB work file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Sat Jun 21, 2003 11:30 am    Post subject: SPLICE with VB work file Reply with quote

Frank,

During I was writing a solution for Mukunda, I was surprised to not
have the result i waited for. I wanted to use RECFM=VB for my work files
to reduce writing unwanted blanks on right. Here is a simplified example
of what I am talking about :

From the IN file which is in RECFM=F where there is one record, I apply
the / OUTFIL OUREC feature to create three records in the OUT file which is
in RECFM=VB and I just add a zero key in col 1 for the SPLICE.
The result I want to have in OUTX is the same record as the IN file with
a zero in first column.
Code:

//TOOLIN   DD *
  COPY   FROM(IN) USING(ICE0)
  SPLICE FROM(OUT) TO(OUTX) ON(5,1,ZD) WITHEACH -
         WITH(7,1) WITH(8,1)
/*
//STEP0001 EXEC PGM=ICETOOL
//DFSMSG   DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//IN       DD *
ABC
/*
//OUT      DD DSN=&T,UNIT=SYSDA,
//            SPACE=(TRK,(1,1)),
//            DCB=(RECFM=VB,LRECL=80),
//            DISP=(,DELETE)
//OUTX     DD SYSOUT=*
//ICE0CNTL DD *
  OUTFIL FNAMES=OUT,
         OUTREC=(1:C'0',2:1,1,/,        /* 0A   */
                 1:C'0-',3:2,1,/,       /* 0-B  */
                 1:C'0--',4:3,1),FTOV   /* 0--C */
/*

OUTX gives :
Code:

0A

and I thought that the result should have been :
Code:

0ABC

If I modify my jcl with :
Code:

  OUTFIL FNAMES=OUT,
         OUTREC=(1:C'0',2:1,1,3:C'XX',/,   /* 0AXX */
                 1:C'0-',3:2,1,4,C'X',/,   /* 0-BX */
                 1:C'0--',4:3,1),FTOV      /* 0--C */

then OUTX gives :
Code:

0ABC

just that I wanted.

In this case, it means that I must use a file in RECFM=FB for the 'in- between' step or construct an appropriate OUTREC like the second OUTFIL.

What do I misunderstand ?

Alain


Last edited by Alain Benveniste on Sun Jun 22, 2003 6:13 am; edited 8 times in total
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sun Jun 22, 2003 10:25 am    Post subject: Reply with quote

Alain,

You're missing this from the description of "WITH(p,m)":

Quote:

A WITH field will not be used to overlay the RDW of a variable-length base record, to overlay bytes beyond the end of a base record, or to overlay bytes from beyond the end of an overlay record on to a base record. When necessary, WITH fields will be adjusted to prevent these situations. For example, if WITH(1,6) is specified for a variable-length record, it will be treated as WITH(5,2) and if WITH(75,10) is specified for an 80-byte base record or overlay record, it will be treated as WITH(75,6).


SPLICE does NOT change the record length of the base record. In your first case, your base record is 6 bytes long and looks like this:

Code:

| RDW | 0 | A |


Your overlay records are 7 and 8 bytes, respectively, but the base record will NOT be increased to 7 or 8 bytes - it will remain as 6 bytes. So WITH(7,1) and WITH(8,1) are ignored.

In your second case, your base record is 8 bytes long and looks like this:

Code:

| RDW | 0 | A | X | X |


Since your base record is now 8 bytes long, WITH(7,1) and WITH(8,1) can be used.

SPLICEing is a process of overlaying existing bytes in the base record with existing bytes in the overlay record - the extra blanks are necessary for this process so it doesn't make sense to try to eliminate them by converting from FB to VB.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort


Last edited by Frank Yaeger on Sun Jun 22, 2003 2:13 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Sun Jun 22, 2003 1:31 pm    Post subject: Reply with quote

Even on sunday guys like me need to ask something.
Even on sunday you find time to respond ...
Always ready to rescue a dfsorter.
Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group