View previous topic :: View next topic
|
Author |
Message |
sudhakar_mainframe Warnings : 1 New User
Joined: 29 Jun 2006 Posts: 25
|
|
|
|
Hi all.
I have a requirement to convert the CH to PD.
-1234
-1234.2
-1234.25
OUTREC FIELDS=(1,14,SFF,TO=PD.LENGTH=7)
But i got the below output.
-12.34
-123.42
-1234.25
suggest me how can i convert the data from char to PD without disturbing the decimal positions
Thanks.
Sudhakar. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Please use the Code Tags to preserve spacing. Please paste from your emulator to avoid typos. Please try to search the forum before asking, as this issue has been addressed in the past. |
|
Back to top |
|
|
sudhakar_mainframe Warnings : 1 New User
Joined: 29 Jun 2006 Posts: 25
|
|
|
|
Not able to get the links. Please give some of them. Explain me with some examples
Thanks,
Venkata. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
Back to top |
|
|
sudhakar_mainframe Warnings : 1 New User
Joined: 29 Jun 2006 Posts: 25
|
|
|
|
This link is not much useful.
The I/p data looks like below
----+----|
-1234
-1234.2
-1234.25
The output should looks like below
----+----|
-1234.00
-1234.20
-1234.25
Thanks,
Sudhakar.
Thanks |
|
Back to top |
|
|
Abid Hasan
New User
Joined: 25 Mar 2013 Posts: 88 Location: India
|
|
|
|
Hello,
The link Bill has shared gives you more than enough information to go on; did you look up the DFSORT manual on the usage of PARSE?
You should be able to build the SORT card using that information, instead of having someone spoon-feed the solution for you. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
In your sample data, you show a fixed start, and a fixed position for the decimal point.
If that accurately and fully represents your data, then you won't need PARSE. Just IFTEHN=(WHEN=(logical expression) for, first C' ' in the last three bytes, with OVERLAY for C'.00', then for C' ' in the last byte, and change to C'0'.
However, with a variable start, or a variable number of integer digits, you will have to use PARSE. Your existing use of SFF implies a "free format" (non-fixed) field. but there is no necessity that that was a good choice. |
|
Back to top |
|
|
|