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

Author Message

Active User

Joined: 01 Feb 2007
Posts: 120

Posted: Mon Nov 24, 2008 6:53 pm    Post subject: convert from ch to zd

Hi,

I want to convert from CH to ZD format.

Input has the field of type X(20).
This should be converted to 9(20).

Suppose if the input X(20) has value '01111101234567'
The output 9(20) should have the value as '01111101234567000000'

I tried to convert as follows:
 Code: OUTREC FIELDS=(1:1,20,UFF,TO=ZD,LENGTH=20)

But the value is moved to 9(20) as '00000001111101234567'

Suggest me what to be done.

expat

Global Moderator

Joined: 14 Mar 2007
Posts: 8657
Location: Back in jolly old England

 Posted: Mon Nov 24, 2008 7:38 pm    Post subject: To me it seems logical that as a numeric the additional zeros would go to the front of the field to preserve that integrity of the data. Going from '01111101234567' to '01111101234567000000' implies a multiplication operation has been performed. Are you sure that your requirement is correct ?

Active User

Joined: 01 Feb 2007
Posts: 120

 Posted: Mon Nov 24, 2008 8:07 pm    Post subject: Reply to: convert from ch to zd Hi expat, Actually i want to move from X(20) to the below fields FLD1 9(6) FLD2 9(2) FLD3 9(8) FLD4 9(2) FLD5 9(2) That why i gave as 9(20). The value in input X(20) can contain 14 digits or 16 digits or 18 digits. It may vary for each record. So i treid to convert the entire X(20) to 9(20).
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

 Posted: Mon Nov 24, 2008 10:32 pm    Post subject: You really haven't made it clear what you want to do. You say you have a X(20) field (20 characters) that can have 14, 16 or 18 digits. Then you say you want to split that up into different ZD fields of 6, 2, 8, 2 and 2 digits which is 20 digits in total. But you haven't given any indication of how you want to map the 14, 16 or 18 digits of the input field to the 20 digits of the output field. In your original example, you had 14 digits and added 6 0's on the right, but didn't explain why. Do you just want to fill out the digits with 0s on the right to get 20 characters? Or do you want to do something else? If something else, explain in detail.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Can EDCICONV convert EBCDIC to ASCII... natt.sut IBM Tools 3 Fri Nov 17, 2017 8:46 pm Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm

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