Page 1 of 1

Need one sort card

PostPosted: Fri May 08, 2009 5:25 pm
by vgupta54
I have one VB file of 256 LRECL. I have to copy the data in another FB file with 98 LRECL.

Ex:
File 1 data:
gdfd dfgdf
fgd dfdfdf
fdgfh dgfj

So I need file 2 data:
gdfd d
fgdffg
d dfdf
dffdgf
h dgfj

Re: Need one sort card

PostPosted: Fri May 08, 2009 9:19 pm
by Frank Yaeger
Your example doesn't make much sense, but here's a DFSORT job that will do what you asked for in your description.

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB/256)
//SORTOUT DD DSN=...  output file (FB/98)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL VTOF,BUILD=(5,98)
/*


For more information, see the "VB to FB conversion" Smart DFSORT Trick at:

http://www.ibm.com/systems/support/stor ... vs/tricks/

Re: Need one sort card

PostPosted: Sat May 09, 2009 12:52 am
by dick scherrer
Hi Frank,

I may be way off, but i believe the goal is to "slice" off 98 bytes of data in the 256 lrecl file and then start the next 98 byte output starting with pos 99. When the "end" of a 256-byte record is reached, the last 46 bytes should start the next 98-byte record and the first bytes of the next 256-byte record should be appended so there are no breaks between byte 256 of the first record and byte 1 of the second record. . . Whew. . .

As i mentioned, i may be way off, but looking at the abbreviated sample data. . . .

Re: Need one sort card

PostPosted: Sat May 09, 2009 1:22 am
by vgupta54
Hi Frank ,
Thanks for help but Dick Scherrer is on the right way . I need the o/p in the same way that Dick has suggested.

Re: Need one sort card

PostPosted: Sat May 09, 2009 2:38 am
by Frank Yaeger
Wow, I sure didn't get that from the original post.

Are the VB input records really all 256 bytes long or can some of them be shorter than 256 bytes?

Re: Need one sort card

PostPosted: Sun May 10, 2009 10:09 am
by vgupta54
Yes they have 256bytes long for all input records.......