Can we convert char into packed decimal using sort?

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.
Post Reply
Rahul
Registered Member
Posts: 23
Joined: Thu Jan 23, 2014 9:06 am

Can we convert char into packed decimal using sort?

Post by Rahul »

Hi,

Can we convert char into packed decimal using sort?
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Can we convert char into packed decimal using sort?

Post by Anuj Dhawan »

The short answer is - yes!
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Rahul
Registered Member
Posts: 23
Joined: Thu Jan 23, 2014 9:06 am

Re: Can we convert char into packed decimal using sort?

Post by Rahul »

Sorry for the confusion, I was looking for a way to add the odd and even number to the records. it will help me to further develop a strategy.
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Can we convert char into packed decimal using sort?

Post by Anuj Dhawan »

Since you haven't given any real details about what PIC clause you might be using to define the 'character' - assuming it's PIC X(10) and assuming them as ZD is safe. In that case, you would use SORT control statements something like this where p is the starting position of the field:

Code: Select all

OPTION COPY
    INREC BUILD=(p,10,ZD,TO=PD)
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Rahul
Registered Member
Posts: 23
Joined: Thu Jan 23, 2014 9:06 am

Re: Can we convert char into packed decimal using sort?

Post by Rahul »

Thanks Anuj, I have adapted the given solution and it seems to work for me.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DFSort, ICETOOL, ICEMAN, ICEGENER.”