Page 1 of 1

DATA Type Conversion using SYNCSORT

PostPosted: Wed Apr 29, 2015 2:07 am
by beeram527
Hi,
Can some one please assist me for the following Data Type conversions with SYNCSORT.

1.) I have source file field with S9(17) and need to convert this to S9(11)V99 Comp3.

2.) I have another field with Date in Julian (Eg .. 2015114). I need to convert this to : YYYY-MM-DD.

3.) Another field with S9(4) and need to convert into X(4).

Can someone please suggest how this can be achieved by using SYNCSORT and what should be mentioned at OUTREC field.

Regards,
Sree.

Re: DATA Type Conversion using SYNCSORT

PostPosted: Wed Apr 29, 2015 2:46 am
by BillyBoyo
For 1), assuming that the V99 part must always be zero in the conversion, MULtiply by +100 with TO=PD,LENGTH=7
For 2), you should have some date functions, without checking I think JULTOGREG, but check your documentation
For 3), use an EDIT without specifying a sign, or TO=ZDF,LENGTH=4

Re: DATA Type Conversion using SYNCSORT

PostPosted: Wed Apr 29, 2015 3:51 am
by beeram527
Billy,
Thank you.
1.) Yes , last 2 digits can be 00. But the following is giving me syntax error :
056:039,09,PD,+100,MUL,TO=PDF,LENGTH=7,

056:039,09,PD,+100,MUL,TO=PD,LENGTH=7,

Tried few other options but no luck. Not able to get exact syntax from google or from any other documentation. Please provide me If you have the syntax with you.

2.) I am trying to get thru some documentation on JULTOGREG.

3.) TO=ZDF,LENGTH=4 is working fine for me.

Thanks again for your help.

Re: DATA Type Conversion using SYNCSORT

PostPosted: Wed Apr 29, 2015 6:22 am
by beeram527
Hi,

1) Solved with the following:
056:(039,09,PD,MUL,+100),TO=PD,LENGTH=7,

2.) Can any one assist me to convert Julian Date in Packed Decimal ( S9(07), 4 Byte, Eg ... 2015105 or 2015114 ... ) to YYYY-MM-DD format.

Re: DATA Type Conversion using SYNCSORT

PostPosted: Wed Apr 29, 2015 1:49 pm
by BillyBoyo
OK, I guessed the names of the date functions incorrectly. I was really close. Have a look at DT and DTNS. Just a few differences in the letters.

Re: DATA Type Conversion using SYNCSORT

PostPosted: Wed Apr 29, 2015 3:56 pm
by NicC
You have a Syncsort question - not a JCL question. Topic moved to the correct part of the forum.