Variable block to Fixed block conversion



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Variable block to Fixed block conversion

Postby vinayaka1 » Wed Aug 17, 2011 11:03 pm

Hello

I have one VB file and I have to convert it into FB
For ex I have VB file having record length of 1000 bytes.. now I have to convert it into FB of 2000 bytes.
while converting like this first 4 bytes will lost

I have to use the FB 2000 bytes file for some processing and output will also be FB 2000 bytes.

Now I have to convert this FB 2000 bytes file to VB of 1000 bytes and the latest VB file will also have records that are in original file but when I compare those two they are different

What I want now is when I compare orignal VB file and the latest vb file both should be same.
vinayaka1
 
Posts: 3
Joined: Tue Aug 16, 2011 6:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Variable block to Fixed block conversion

Postby vinayaka1 » Wed Aug 17, 2011 11:07 pm

regarding previous post please suggest by which utility my requirement will be fulfilled. I want to do this operation using JCL
vinayaka1
 
Posts: 3
Joined: Tue Aug 16, 2011 6:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Variable block to Fixed block conversion

Postby Frank Yaeger » Thu Aug 18, 2011 12:01 am

You can use this DFSORT job to convert from VB to FB:

//VF EXEC PGM=SORT                                                 
//SYSOUT DD SYSOUT=*                                               
//SORTIN DD DSN=...  input file (VB/1000)                         
//SORTOUT DD DSN=...  output file (FB/2000)     
//SYSIN DD *                                                       
  OPTION COPY                                                       
  OUTFIL VTOF,BUILD=(5,996,2000:X),VLFILL=C' '                     
/*                                                                 


You can use this DFSORT job to convert back from FB to VB:

//FV EXEC PGM=SORT                                                 
//SYSOUT DD SYSOUT=*                                               
//SORTIN DD DSN=...  input file (FB/2000)       
//SORTOUT DD LRECL=1000,DSN=...  output file (VB/1000)                                                     
//SYSIN DD *                                                       
  OPTION COPY                                                       
  OUTFIL FTOV,VLTRIM=C' '                                           
/*     
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Variable block to Fixed block conversion

Postby dick scherrer » Thu Aug 18, 2011 12:09 am

Hello,

If, after using the conversion jobs Frank provided, the files still do not match, post the first 3 records from each file (using HEX ON).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Variable block to Fixed block conversion

Postby Frank Yaeger » Thu Aug 18, 2011 1:13 am

I suppose I should have mentioned that my solution assumes that the original VB input file does NOT have trailing blanks. If it does, we could use a different VLFILL/VLTRIM character instead of blank (e.g. X'FF').
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Variable block to Fixed block conversion

Postby vinayaka1 » Thu Aug 18, 2011 12:58 pm

File has trailing blanks and I used above jobs by using c'*' already but it didn't work.
actually my original VB input is 15004 length and has keyfields and it is converted to 20000 FB by exracting few records using key fields and outrec is represented in the below format
"OUTREC=(1:5,15000,15001:625C' '),CONVERT"
It is again coverted into VB of 15004 by just using OUTFIL FTOV.
Please let me know if you have any doubts and let me know what I can do now to get the result
vinayaka1
 
Posts: 3
Joined: Tue Aug 16, 2011 6:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Variable block to Fixed block conversion

Postby dick scherrer » Fri Aug 19, 2011 5:42 am

Hello,

let me know what I can do now to get the result


If the records are too long to post, you can still look the first few on your terminal. . .

Browse one file (hex on)
Split the screen
Browse the other (hex on)
Sync both screens and then srcoll right until you find the dofference

Or write some code to compare the files byte-by-byte and identify any difference(s).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post