Page 1 of 1

convert file VB TO FIXED FILE with logical length in firt po

PostPosted: Mon Dec 13, 2010 10:54 pm
by jeugenio
Hello,

I would like to convert a variable File (VB) to a fixed file. But i want that in the fixed file i have in the first position the logical length of the varible file (vb).

Thank you for all,

Re: convert file VB TO FIXED FILE with logical length in firt po

PostPosted: Mon Dec 13, 2010 11:22 pm
by Frank Yaeger
What format do you want the length in? If you use only one position for the length, that will limit you to a maximum length of 255 (BI), or 99 (ZD). Be more specific about what you want exactly.

What is the LRECL of the VB input file? What do you want for the LRECL of the FB output file?

Re: convert file VB TO FIXED FILE with logical length in firt po

PostPosted: Tue Dec 14, 2010 2:54 am
by jeugenio
My lRECL of the VB input file is 618, 4 firt position i can´t see because these position are logical length. this logical length i want in the FB with LRECL 618.

Exemple:

VB:

ABCDEFGHIJK

FB

0011ABCDEFGHIJK

Re: convert file VB TO FIXED FILE with logical length in firt po

PostPosted: Tue Dec 14, 2010 3:06 am
by dick scherrer
Hello,

How will placing the length within the data be useful?

Re: convert file VB TO FIXED FILE with logical length in firt po

PostPosted: Tue Dec 14, 2010 6:15 am
by Frank Yaeger
i want that in the fixed file i have in the first position the logical length of the varible file (vb).


I guess you meant you want the readable logical length starting in the first position. The RDW in the first four bytes actually contains the binary length in the first two bytes and zeros in the third and fourth bytes. You can use a DFSORT job like the following to do what I think you're asking for:

//S1 EXEC PGM=SORT                                                 
//SYSOUT DD SYSOUT=*                                               
//SORTIN DD DSN=...  input file (VB/618)         
//SORTOUT DD DSN=...  output file (FB/618)     
//SYSIN DD *                 
  OPTION COPY                                     
  OUTFIL VTOF,BUILD=(1,2,BI,EDIT=(TTTT),5,614)   
/*                 

Re: convert file VB TO FIXED FILE with logical length in firt po

PostPosted: Tue Dec 14, 2010 10:16 am
by dick scherrer
Hi Frank,

I'm still curious just why this is wanted. . .

Seems like a waste of processing as well as an extra copy of the entire file. . .

Maybe TS will clarify.

d

Re: convert file VB TO FIXED FILE with logical length in firt po

PostPosted: Wed Dec 15, 2010 5:14 pm
by jeugenio
Thanks.

I want this issue because i need to send this file with the length of record in the file to a delayer and it has this specification to receipt file.

Re: convert file VB TO FIXED FILE with logical length in firt po

PostPosted: Thu Dec 16, 2010 1:50 am
by dick scherrer
Thanks for the clarification :)

d