Page 1 of 2

OUTREC RDW not included in SYNCSORT

PostPosted: Thu Sep 16, 2010 5:37 pm
by ramyas
Hi,

I am trying to insert 3 fields at a position of the input file depending on a condition and write it into output file. The input file is VB file and i want the output as VB file.

I have used the following sort card...

OPTION COPY                                 
OUTREC IFTHEN=(WHEN=(27,01,CH,EQ,C'1'),     
                OVERLAY=(1,4,         
                         05:5,396,         
                         396:5Z,           
                         401:5Z,           
                         406:5Z,           
                         469:396,500)) 


both the outfile and input file parameters are matching.
I am getting the error
WER235A OUTREC RDW NOT INCLUDED

I have left the first 4 bytes for RDW in output and in the input... but still its giving me the error.

Ramya

Re: OUTREC RDW not included

PostPosted: Thu Sep 16, 2010 11:22 pm
by dick scherrer
Hello,

Suggest you try BUILD.

Re: OUTREC RDW not included

PostPosted: Fri Sep 17, 2010 11:10 am
by jlipica
Hi,

Even when we are trying with BUILD getting the same error( OUTREC RDW NOT INCLUDED ).

The input file format is VB and the output file is FB.

Code :
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(5,2,CH,EQ,C'TYPE1'),BUILD=(1:348,11,12:10,10)),
IFTHEN=(WHEN=(5,2,CH,EQ,C'TYPE2'),BUILD=(1:348,11,12:10,10))

Could anyone please provide any sample sortcard for this/A solution for this.

Regards,
Lipica

Re: OUTREC RDW not included

PostPosted: Fri Sep 17, 2010 11:55 am
by ramyas
Hi,

I tried with Build, Its working fine now.
Thanks scherrer :) .

But made slight changes to get exact output.
OPTION COPY
OUTREC IFTHEN=(WHEN=(27,01,CH,EQ,C'1'),
BUILD=(1,395,
396:5Z,
401:5Z,
406:5Z,
469:396,500)) .

Lipica,

I found the following information in DFSORT manual... Pasting it here...
hope this will help u...

Converting VB to FB
You can convert a VB data set to an FB data set with OUTFIL’s VTOF and BUILD or OUTREC parameters. All of the PARSE, BUILD, or OUTREC features are available (input fields, strings, editing, and so on). For VTOF, you specify the input positions of the VB input record (with the RDW), and the output columns of the FB output record (without the RDW). DFSORT does not include the RDW in the FB output records.
Attention: You cannot specify OVERLAY or IFTHEN with VTOF.

The following JCL and DFSORT control statements convert a VB data set with LRECL=104 to an FB data set with LRECL=100:
//VBFB JOB A92,PROGRAMMER
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=A123456.VBIN,DISP=SHR
//FBOUT DD DSN=A123456.FBOUT, DISP=(NEW,CATLG,DELETE),
// UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=FBOUT,VTOF,OUTREC=(5,100)
/*

Up to 100 bytes of data starting at position 5 (after the RDW) of the VB input record appears in the FB output record starting at position 1. The FB output records are all 100 bytes long. By default, if a VB input record has less than 100 data bytes, DFSORT pads the output data with blanks on the right to 100 bytes. However, you can change the padding character to anything you like with OUTFIL’s VLFILL parameter. For example, VLFILL=C’*’ pads with asterisks and VLFILL=X’00’ pads with binary zeros:

SORT FIELDS=(25,10,CH,A)
*Pad short fields on the right with blanks (default is VLFILL=C’ ’)
OUTFIL FNAMES=PADB,VTOF,
OUTREC=(41,40,C’Blank padding’,11,20)
* Pad short fields on the right with asterisks
OUTFIL FNAMES=PADA,VTOF,
OUTREC=(5,60,C’Asterisk padding’,61,40),VLFILL=C’*’.
* Pad short fields on the right with binary zeros
OUTFIL FNAMES=PADZ,VTOF,
OUTREC=(21,60,C’Binary zero padding’),VLFILL=X’00’

LRECL=73 is set for the PADB output data set, which has 73 byte FB records. Short input fields are padded with blanks on the right as needed.
LRECL=116 is set for the PADA output data set, which has 116 byte FB records. Short input fields are padded with asterisks on the right as needed.
LRECL=79 is set for the PADZ output data set, which has 79 byte FB records. Short input fields are padded with binary zeros on the right as needed.

Re: OUTREC RDW not included

PostPosted: Fri Sep 17, 2010 11:57 am
by ramyas
So... better u first convert it into FB and then apply ur conditions and Build the outrec based on the conditions.

Re: OUTREC RDW not included

PostPosted: Fri Sep 17, 2010 1:41 pm
by jlipica
Hi ramyas,

As VTOF will not work with IFTHEN. Could you please suggest any other way for the previous post.

Regards,
Lipica

Re: OUTREC RDW not included

PostPosted: Fri Sep 17, 2010 6:39 pm
by shyamsaravan
Hi;

Just try this code..it will create a FB outfile as well as copied all records from VB inputfile

VB inpt LRECL=100
FB out LRECL=96

//STEP1      EXEC PGM=SORT                         
//SYSPRINT   DD SYSOUT=*                           
//SYSOUT     DD SYSOUT=*                                               
//SORTIN     DD DSN=input.VBin,           
//             DISP=SHR                           
//SORTOUT    DD DSN=output.FBOUT,           
//             DISP=(,CATLG,DELETE),           
//             UNIT=SYSDA,SPACE=(TRK,(15,15),RLSE),
//             DCB=(RECFM=FB,LRECL=96) 
//*                                               
//SYSIN    DD    *                                 
    SORT FIELDS=COPY                               
      OUTREC FIELDS=(5,96),CONVERT                 
      OUTFIL IFTHEN=(WHEN=(92,4,CH,EQ,X'00'),     
                             OVERLAY=(92:X'0C'))   


Thanks;
Saravan

Re: OUTREC RDW not included

PostPosted: Fri Sep 17, 2010 6:41 pm
by ramyas
as per the knowledge i have...
one thing is u can convert the file into fixed and then apply OUTREC IF THEN on that file...

Re: OUTREC RDW not included

PostPosted: Fri Sep 17, 2010 6:49 pm
by MrSpock
Ramya, I know you posted some documentation out of the DFSORT manual, but I wonder if it might help the other Syncsort users such as yourself if you could post the similar information out of the Syncsort manual?

Re: OUTREC RDW not included

PostPosted: Thu Aug 04, 2011 3:17 pm
by fornanthakumar
Hi,

Please help me out on the below option,

1. SORTIN = VB file ( total LRECL is 229 , actual length is 233 (include RDW)
2. SORTOUT = FB file ( total length is 349, file already created and i opened in share mode)

Purpose to get those 229 characters from VB file and placed in SORTOUT's file from position (100).

How do i reformat my records in SORTOUT file,
OPTION COPY
OUTFIL FNAMES=SORTOUT,VTOF,OUTREC=(100:5,229) it will give error like,

229 Fixed length will not equal to 250 LRECL of SORTOUT...

Please help me out..