Hi,
Can we convert char into packed decimal using sort?
Can we convert char into packed decimal using sort?
- Anuj Dhawan
- Founder
- Posts: 2824
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Can we convert char into packed decimal using sort?
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.
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.
Re: Can we convert char into packed decimal using sort?
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.
- Anuj Dhawan
- Founder
- Posts: 2824
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Can we convert char into packed decimal using sort?
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.
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.
Re: Can we convert char into packed decimal using sort?
Thanks Anuj, I have adapted the given solution and it seems to work for me.
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