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

Author Message
selvan_nn

New User

Joined: 16 Oct 2007
Posts: 12
Location: Chennai

 Posted: Fri Aug 16, 2013 3:35 am    Post subject: How to convert Numeric values to zoned decimal values Hi, I trying to convert the singed numeric values to Zoned decimal values like this. Singed Numeric values: -0000000001.02 -0000000001.39 -0000000000.35 -0000000005.21 -0000000001.97 -0000000008.61 -0000000002.00 -0000000000.35 -0000000104.73 -0000000174.69 Expecting Zoned decimal values: 00000000010B 00000000013I 00000000003E 00000000052A 00000000019G 00000000086A 00000000020{ 00000000003E 00000001047C 00000001746I Please help me to convert the values as above using sort card. Thanks, M.S

Bill Woodger

Moderator Emeritus

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

 Posted: Fri Aug 16, 2013 4:03 am    Post subject: Reply to: How to convert Numeric values to zoned decimal val Which SORT product do you use? You have Signed Fixed-Format fields. See if you can find in your documentation how that is defined to SORT. It should then be a very easy process.
selvan_nn

New User

Joined: 16 Oct 2007
Posts: 12
Location: Chennai

Posted: Fri Aug 16, 2013 4:06 am    Post subject: Re: Reply to: How to convert Numeric values to zoned decimal

 Bill Woodger wrote: Which SORT product do you use? You have Signed Fixed-Format fields. See if you can find in your documentation how that is defined to SORT. It should then be a very easy process.

I am using SYNCSORT for converting the values. Could you please provide the sort card to convert the values as i mentioned..
selvan_nn

New User

Joined: 16 Oct 2007
Posts: 12
Location: Chennai

 Posted: Fri Aug 16, 2013 4:10 am    Post subject: Reply to: How to convert Numeric values to zoned decimal val Pls provide the sort card the values as I mentioned. I am using SYNCSORT for converting the values.
Bill Woodger

Moderator Emeritus

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

Posted: Fri Aug 16, 2013 5:49 am    Post subject: Reply to: How to convert Numeric values to zoned decimal val

Well, it is something like this:

 Code: OPTION COPY   INREC OVERLAY=(start,length,type,TO=ZD,LENGTH=length)

Not so difficult. I've told you how to find out about the "type" and even given a big clue for a possibility.

Open a manual. Search the forum. Google. It is too simple to ask for help with. Sorry, not even ask for help, but ask to be done.

Good night.
selvan_nn

New User

Joined: 16 Oct 2007
Posts: 12
Location: Chennai

 Posted: Fri Aug 16, 2013 8:27 pm    Post subject: Reply to: How to convert Numeric values to zoned decimal val I tried the same sort card OUTREC FIELDS=(5,15,SFF,ZD,LENGTH=10) earlier but the result is not coming as expected. I/P 000000000139 000000000035 000000000521 000000000197 000000000861 000000000200 000000000035 The results of the Sort O/P Came as below: 0000000139 0000000035 0000000521 0000000197 0000000861 0000000200 0000000035 But the results should be like below: 000000013I 000000003E 000000052A 000000019G 000000086A 000000020} 000000003E Please check the results and revert back with your suggestions.
Bill Woodger

Moderator Emeritus

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

 Posted: Fri Aug 16, 2013 8:36 pm    Post subject: Reply to: How to convert Numeric values to zoned decimal val Well, as far as I can see your input shows no signs. I think that might be a problem. If you have signs and lost them, paste them again, in the Code tags please, to preserve formatting/spacing.
selvan_nn

New User

Joined: 16 Oct 2007
Posts: 12
Location: Chennai

 Posted: Fri Aug 16, 2013 8:45 pm    Post subject: Reply to: How to convert Numeric values to zoned decimal val Hi, Thanks for your suggestion. I tried with Sign as below: -000000000102 +000000000139 +000000000035 +000000000521 +000000000197 +000000000861 +000000000200 +000000000035 -000000010473 +000000017469 +000000022415 +000000004840 The O/P came as below: 000000010K 0000000139 0000000035 0000000521 0000000197 0000000861 0000000200 0000000035 000001047L 0000017469 0000022415 0000004840 But it Should be as below: 000000010K 000000013I 000000003E 000000052A 000000019G 000000086A 000000020} 000000003E 000001047L 000001746I 000002241E 000000484} I used the below sort card SORT FIELDS=COPY INREC FIELDS=(1,15,SFF,ZD,LENGTH=10) Please provide your suggestion. I am waiting for your reply
Nic Clouston

Global Moderator

Joined: 10 May 2007
Posts: 2408
Location: Hampshire, UK

Posted: Fri Aug 16, 2013 9:13 pm    Post subject:

 Quote: in the Code tags please, to preserve formatting/spacing

What is so hard about using the code-tags? If you are not prepared to help those prepared to help you then why should they bother helping you? And why are you demanding code? Are you prepared to pay people for their time nd expertise in producing code for you?
Bill Woodger

Moderator Emeritus

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

 Posted: Fri Aug 16, 2013 9:40 pm    Post subject: Reply to: How to convert Numeric values to zoned decimal val OK, change ZD to ZDC.
selvan_nn

New User

Joined: 16 Oct 2007
Posts: 12
Location: Chennai

 Posted: Fri Aug 16, 2013 10:14 pm    Post subject: Reply to: How to convert Numeric values to zoned decimal val I just asked you to help not asking any code... Also i used based on your I/P s... The way you responded to me was why came to us... B'se we dont know anything... If you are know the issue help me out.. Otherwise leave it.. I wasted my time...
selvan_nn

New User

Joined: 16 Oct 2007
Posts: 12
Location: Chennai

 Posted: Fri Aug 16, 2013 10:16 pm    Post subject: Reply to: How to convert Numeric values to zoned decimal val Thats all I want... Its working fine... Thanks a lot for your help....
Akatsukami

Global Moderator

Joined: 03 Oct 2009
Posts: 1789
Location: Bloomington, IL

Posted: Fri Aug 16, 2013 10:19 pm    Post subject: Re: Reply to: How to convert Numeric values to zoned decimal

 selvan_nn wrote: B'se we dont know anything...

Your join date is 16 Oct 2007. Unless you have taken over this ID from someone else, it is to be presumed that you have at least five and a half years' experience. What have you been doing in that time that you haven't learned anything?
dick scherrer

Moderator Emeritus

Joined: 23 Nov 2006
Posts: 19254
Location: Inside the Matrix

 Posted: Sat Aug 17, 2013 12:14 am    Post subject: Hello, I suspect the time was invested in learning things other than sort . . .? Many organizations still insist that code be written for this type of process . . . Kinda wasteful, but is still the "standard" at these places.
Anuj Dhawan

Senior Member

Joined: 22 Apr 2006
Posts: 6254
Location: Mumbai, India

Posted: Tue Aug 20, 2013 11:21 am    Post subject: Re: Reply to: How to convert Numeric values to zoned decimal

 selvan_nn wrote: I just asked you to help not asking any code...
Is there a language barrier in here?

Nic talked about using BBCode Tags, written in PHP programming language to give the records (input/output) a feel like if they will come on a Mainframe Terminal. This is available above the "reply box" in rectangular box with "Code" written on it:

For example, this is not coded and this is the way you show it:

-000000000102
+000000000139
+000000000035
+000000000521
+000000000197
+000000000861
+000000000200
+000000000035
-000000010473
+000000017469
+000000022415
+000000004840

and this is coded:
 Code: -000000000102 +000000000139 +000000000035 +000000000521 +000000000197 +000000000861 +000000000200 +000000000035 -000000010473 +000000017469 +000000022415 +000000004840

BBcode(code-tags) and some "code" are too different to be compared...Don't get confused with them.
 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 a copybook getting improper values in... Mahammad Musthafa COBOL Programming 7 Sat Jul 18, 2020 12:58 am how to convert Hex String t char hex Martylin PL/I & Assembler 6 Fri Jun 05, 2020 7:45 pm JDBC Driver -Default Values yogi.47eie DB2 1 Mon May 18, 2020 7:27 pm Get next 5 numeric from a string of '... maxsubrat COBOL Programming 7 Fri Apr 24, 2020 2:30 pm

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