Page 1 of 1

VB inrec failing with error

PostPosted: Wed Apr 10, 2013 3:21 pm
by Nandesh
Hi , I need to remove a quotation mark from a VB input file(59 lrecl) and output into a VB file(59 lrecl)

Input:

000001 "Detail ID,Partnum2,Plant,Cost_update1,Effective_Date2"
000002 "1,0000045E0002,1202,0000259.320,00000000"
000003 "1,000000449021,1202,0006284.000,00000000"
000004 "1,000000719410,1202,0009953.000,00000000"
000005 "1,000000719420,1202,0009953.000,00000000"
000006 "1,000001624775,1202,0000000.190,00000000"

Output:
000001 Detail ID,Partnum2,Plant,Cost_update1,Effective_Date2"
000002 1,0000045E0002,1202,0000259.320,00000000
000003 1,000000449021,1202,0006284.000,00000000
000004 1,000000719410,1202,0009953.000,00000000
000005 1,000000719420,1202,0009953.000,00000000
000006 1,000001624775,1202,0000000.190,00000000
when used:
OPTION COPY
INREC BUILD=(1,4,5:6,40,46:47,13)

ending with error as:
ICE218A 6 46 BYTE VARIABLE RECORD IS SHORTER THAN 59 BYTE MINIMUM FOR

Till this
OPTION COPY
INREC BUILD=(1,4,5:6,40 it was fine working

only on that 46:47,13) part getting this error. Please advise

Re: VB inrec failing with error

PostPosted: Wed Apr 10, 2013 3:28 pm
by BillyBoyo
Well, it's just read a 46-byte record, and you are trying to access data beyond the end of that record.

How about
  INREC FINDREP=(IN=C'"',OUT=C'')

Re: VB inrec failing with error

PostPosted: Wed Apr 10, 2013 3:35 pm
by Nandesh
Hi, We need the input without " but we need the output in column 1( for VB coln 5)

Re: VB inrec failing with error

PostPosted: Wed Apr 10, 2013 3:37 pm
by Nandesh
Hi, yes it worked well. Thanks

Re: VB inrec failing with error

PostPosted: Wed Apr 10, 2013 4:46 pm
by BillyBoyo
I'm not sure what you mean by the first comment, but I did make a mistake due to the V, sorry about that.

Should be

  INREC FINDREP=(IN=C'"',OUT=C'',STARTPOS=5)


Otherwise X'5C' from the record-length could get messed.

Re: VB inrec failing with error

PostPosted: Wed Apr 10, 2013 10:19 pm
by skolusu
BillyBoyo wrote:I'm not sure what you mean by the first comment, but I did make a mistake due to the V, sorry about that.

Should be

  INREC FINDREP=(IN=C'"',OUT=C'',STARTPOS=5)


Otherwise X'5C' from the record-length could get messed.


Billyboyo,

No you did NOT make a mistake. The default STARTPOS is position 1 for a fixed-length record or position 5 for a variable-length record. DFSORT is smart enough to ignore STARTPOS < 5 for VB records. 8-) If p is less than 5 for a variable-length record, 5 will be used for startpos.

Re: VB inrec failing with error

PostPosted: Thu Apr 11, 2013 3:07 pm
by BillyBoyo
OK, so I made a mistake the second time :-)

Re: VB inrec failing with error

PostPosted: Thu Apr 11, 2013 7:47 pm
by dick scherrer
As the old saying went, "My only mistake was thinking i made a mistake" ;)

d