View previous topic :: View next topic
|
Author |
Message |
M.RAJAN
New User
Joined: 18 Jul 2005 Posts: 5 Location: chennai
|
|
|
|
Hi All,
I am trying to convert Cobol Data type S9(11)v99 into Ezytrieve data type. We have existing Cobol program just to reformat from One file to another. I want to convert Cobol program to Ezytrieve program. i almost done the program except these data type conversion.
Can you please someone help me to convert the data from S9(11)V99 into Ezytrieve format ? Below is the given layout for input file.
Input file:
9234234232500 CHENNAI
5343242422340 DELHI
8342424234320 MUMBAI
Expecting output file.
Number City
923423423250{ CHENNAI
534324242234{ DELHI
834242423432{ MUMBAI |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Unless you need a sign-nibble for the last-byte, move the S9(11)V99 field to a 9(11)V99 work-field and the sign-nibble will be dropped.
When signed (and I'm assuming positive), the last byte will be in the range of X'C0' through X'C9'.
Once you move it to an unsigned work-field, the range of the last byte will be X'F0' through X'F9', which is a format EZT can handle easily.
Bill |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Or define a mask on the EZT definition to account for the sign and the EZT display will be what you want.... |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Your input looks like a zoned decimal field :
INFIELD 1 13 N MASK('99999999999.99')
Your output field looks like packed decimal :
UTFIELD 1 7 P 2
This will do the job :
UTFIELD = INFIELD |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The posted "output" does not look like packed decimal. . .
Suggest that it signed zoned decimal.
Could the value ever be negative? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
dick scherrer wrote: |
Hello,
The posted "output" does not look like packed decimal. . .
Suggest that it signed zoned decimal.
|
Thats right Dick, its signed zoned decimal (have to reread my posts).
So i guess the next applies :
UTFIELD 1 11 N 2
From the manual :
If you specify a numeric field with decimal positions (0 to 18),
CA-Easytrieve/Plus considers it a signed (quantitative) field. |
|
Back to top |
|
|
Sudheesh2008
New User
Joined: 23 Jun 2009 Posts: 1 Location: Charlotte
|
|
|
|
Hi All,
Thanks for the reply. The given value is not a packed decimel field. I am new to Ezytrieve and working hard to learn more. I am not aware of Mask definition and UTFIELD. Can you please give me the example and suggest/give me the good Ezytrive manual ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
If your organization is licensed to use Easytrieve, all of the manuals may be downloaded for free from CA Support.
As this material is covered by copyright, we may neither post them nor link to them via our forum.
UTFIELD is a made-up name - it is not something from Easytrieve. |
|
Back to top |
|
|
naveensrimf
New User
Joined: 04 Oct 2005 Posts: 34
|
|
|
|
Cobol S9(11)V99 equalent in Easytrive is 13 N 2. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It is close, but not exactly the same. . . .
The Easytrieve 13 N 2 field has the proper sign for negative numbers (D), but has an F-sign for positive numbers. Sometimes there is a want/need for a C-sign rather than an F-sign.
The COBOL field will have a C-sign when a value is computed. |
|
Back to top |
|
|
|