VB inrec failing with error



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

VB inrec failing with error

Postby Nandesh » Wed Apr 10, 2013 3:21 pm

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
Nandesh
 
Posts: 4
Joined: Sun Aug 14, 2011 7:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: VB inrec failing with error

Postby BillyBoyo » Wed Apr 10, 2013 3:28 pm

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'')
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: VB inrec failing with error

Postby Nandesh » Wed Apr 10, 2013 3:35 pm

Hi, We need the input without " but we need the output in column 1( for VB coln 5)
Nandesh
 
Posts: 4
Joined: Sun Aug 14, 2011 7:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: VB inrec failing with error

Postby Nandesh » Wed Apr 10, 2013 3:37 pm

Hi, yes it worked well. Thanks
Nandesh
 
Posts: 4
Joined: Sun Aug 14, 2011 7:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: VB inrec failing with error

Postby BillyBoyo » Wed Apr 10, 2013 4:46 pm

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
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: VB inrec failing with error

Postby skolusu » Wed Apr 10, 2013 10:19 pm

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.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: VB inrec failing with error

Postby BillyBoyo » Thu Apr 11, 2013 3:07 pm

OK, so I made a mistake the second time :-)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: VB inrec failing with error

Postby dick scherrer » Thu Apr 11, 2013 7:47 pm

As the old saying went, "My only mistake was thinking i made a mistake" ;)

d
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 DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post