Page 1 of 1

How to write Signed Numeric fields in Syncsort?

PostPosted: Fri Jun 22, 2012 10:22 am
by pjagathis
Hi,

I have read the signed numeric fields and rollup the records based on first 2 bytes.

Again I have to write in same format.

My Input File:

02 00000000{
01 00000000{
04 00000001E
01 00000000{
02 00000000{
14 00000000{
13 00000000{
13 00000000{
14 00000000{




Required Output File:


02 00000000{
01 00000000{
04 00000001E
14 00000000{
13 00000000{



Code Used:

Sort Fields=(1,2,CH,A)
 Sum Fields=(3,9,ZD)
Outrec Fields=(001:001,002,
003:X,
004:004,009,ZD,DIV,+10,EDIT=(SIIIIIIIIIT))


Please any one help me. Since writing in unpack format but i need as it is in input format.

Re: How to write Signed Numeric fields in Syncsort?

PostPosted: Fri Jun 22, 2012 12:23 pm
by BillyBoyo
If you want the same format as the input, you have no need of the OUTREC at all. If that is not what you want, you'll have to explain better.

Re: How to write Signed Numeric fields in Syncsort?

PostPosted: Fri Jun 22, 2012 7:18 pm
by dick scherrer
Hello,

Your code shows SORTing the file on the "key" but your "Required output" is not in that order. . .

Re: How to write Signed Numeric fields in Syncsort?

PostPosted: Wed Jul 04, 2012 11:51 am
by pjagathis
Hi d.sch.,

I have manually created the output.. as you said.. it should be in sorted order based on key fields.

Hi BillyBoyo,

I will check on this and let you know soon...

Re: How to write Signed Numeric fields in Syncsort?

PostPosted: Thu Jul 05, 2012 8:40 am
by dick scherrer
Hello,

If you want the output in the same format as the input, do not use EDIT. . .

Re: How to write Signed Numeric fields in Syncsort?

PostPosted: Thu Jul 05, 2012 10:22 am
by pjagathis
Hi dick,

I tried without giving the OUTREC, but it doen't works...

Input:

111111111111100006561{
111111111111100000000{
111111111111100000000{
111111111111100000218G



output :

1111111111111000067797



Code Used:

**                             
    SORT FIELDS=(01,13,CH,A)   
**                             
  SUM FIELDS=(14,9,ZD)         



But i require the output in same as input format..


Could you please help me.....

thanks in advance....

Re: How to write Signed Numeric fields in Syncsort?

PostPosted: Thu Jul 05, 2012 1:25 pm
by BillyBoyo
If you look in your documentation, you might find ZDx for a field type which preserves the sign. I don't have Syncsort documentation.

Re: How to write Signed Numeric fields in Syncsort?

PostPosted: Thu Jul 05, 2012 7:23 pm
by dick scherrer
Hello,

It appears that the output is exactly as specified. Try ZDC and if this does not do what you want try ZDF (both are supported by Syncsort).

If anything is not what you want, post your code and the result here and we can continue.