Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
sudhakar_mainframe
Warnings : 1

New User

Joined: 29 Jun 2006
Posts: 25

 Posted: Wed Jun 04, 2014 7:54 pm    Post subject: Proper Decimal alignment when converting from CH to PD 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.

Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Wed Jun 04, 2014 8:07 pm    Post subject: Reply to: Proper Decimal alignment when converting from CH t 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.
sudhakar_mainframe
Warnings : 1

New User

Joined: 29 Jun 2006
Posts: 25

 Posted: Thu Jun 05, 2014 11:16 am    Post subject: Not able to get the links. Please give some of them. Explain me with some examples Thanks, Venkata.
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Thu Jun 05, 2014 12:17 pm    Post subject: Reply to: Proper Decimal alignment when converting from CH t Try this one.
sudhakar_mainframe
Warnings : 1

New User

Joined: 29 Jun 2006
Posts: 25

 Posted: Thu Jun 05, 2014 1:39 pm    Post subject: Proper Decimal alignment when converting from CH to PD 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
Abid Hasan

New User

Joined: 25 Mar 2013
Posts: 88
Location: India

 Posted: Thu Jun 05, 2014 1:55 pm    Post subject: Reply to: Proper Decimal alignment when converting from CH t 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.
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Thu Jun 05, 2014 5:20 pm    Post subject: Reply to: Proper Decimal alignment when converting from CH t 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.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics To convert numeric to Packed Decimal vinu78 DFSORT/ICETOOL 9 Fri Jul 31, 2020 7:14 pm Convert a packed decimal value to zon... Dinesh Mani DB2 6 Mon Mar 16, 2020 6:02 pm Identifying Packed Decimal data in a ... sojivarkey TSO/ISPF 4 Sat Dec 07, 2019 5:36 am Reading the CSV data in COBOL and mov... wik123 COBOL Programming 4 Tue Dec 03, 2019 5:13 pm Converting spaces to zeroes A_programmers DFSORT/ICETOOL 7 Tue Oct 01, 2019 12:41 am

 © 2003-2020 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us