IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to convert cobol data type S9(11)V99 into Ezytrieve data


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
M.RAJAN

New User


Joined: 18 Jul 2005
Posts: 5
Location: chennai

PostPosted: Fri Apr 09, 2010 12:13 am
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Apr 09, 2010 1:02 am
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Apr 09, 2010 2:19 am
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 09, 2010 12:52 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Apr 09, 2010 7:16 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 09, 2010 7:42 pm
Reply with quote

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
View user's profile Send private message
Sudheesh2008

New User


Joined: 23 Jun 2009
Posts: 1
Location: Charlotte

PostPosted: Mon Apr 12, 2010 9:36 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Apr 12, 2010 10:07 am
Reply with quote

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
View user's profile Send private message
naveensrimf

New User


Joined: 04 Oct 2005
Posts: 34

PostPosted: Fri Apr 16, 2010 1:49 am
Reply with quote

Cobol S9(11)V99 equalent in Easytrive is 13 N 2.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Apr 16, 2010 1:55 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top