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

Query in declaring signed variable in Easytrieve Macro


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hiiamanncy

New User


Joined: 18 Sep 2007
Posts: 9
Location: US

PostPosted: Tue Oct 16, 2007 10:57 pm
Reply with quote

Hi,

Lets say I have a variable define din my copybook as

WS-A PIC S9(7).

Can you please suggest me how should I declare it in Easytrieve Macro?

Thanks.
Nancy
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Oct 16, 2007 11:35 pm
Reply with quote

Hi nancy,

U can use

VARA STARTING-POS 7 N MASK '-9999999'.
Back to top
View user's profile Send private message
hiiamanncy

New User


Joined: 18 Sep 2007
Posts: 9
Location: US

PostPosted: Tue Oct 16, 2007 11:41 pm
Reply with quote

Hi,
I used MASK '-9999999'

I got compilation error "B025 MASK DOES NOT MATCH FIELD"

I used MASK 'ZZZZZZZ-' and I have a check in my Ezt pgm where I check thsi field is NUMERIC. It failed in this check.

Plz suggest. I tried many things but nothing is workign out fine to me..

NAncy
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: Wed Oct 17, 2007 1:28 am
Reply with quote

Hello hiiamnancy and welcome to the forums,

If you post the parts of your code that refer to these fields, we may be better able to help.

Is the field to be used in some calculation or is it only to be placed on a report or ?
Back to top
View user's profile Send private message
hiiamanncy

New User


Joined: 18 Sep 2007
Posts: 9
Location: US

PostPosted: Wed Oct 17, 2007 1:37 am
Reply with quote

Hi,

Here is the part of code:


DISPLAY 'NANCY-RF-QUANTITY:' CX010-RF-QUANTITY
IF CX010-RF-QUANTITY NOT NUMERIC
DISPLAY 'NANCY1-RF-QUANTITY:' CX010-RF-QUANTITY
WS-ERROR-CODE = '017'
PERFORM LOG-THE-ERROR
END-IF


In Sysout, I'm getting
NANCY-RF-QUANTITY: 1
NANCY1-RF-QUANTITY: 1

If RF-Quantity is 1 then it should not go into the IF condition.

Please suggest me how should I define this field in Ezetrieve Macro. I'm reading this field from a file in which thsi field is defined as PIC S9(7)

In Ezetrieve Macro, I have defined thsi field as

CX010-RF-QUANTITY 149 7 N +
MASK 'ZZZZZZZ-'

Please suggest what should I do?

Thanks.
Nancy
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: Wed Oct 17, 2007 1:55 am
Reply with quote

Either it's numeric or it's not....Let us get to the bottom of this....
Before your code:
Code:
DISPLAY 'NANCY-RF-QUANTITY:' CX010-RF-QUANTITY     
IF CX010-RF-QUANTITY            NOT NUMERIC         
    DISPLAY 'NANCY1-RF-QUANTITY:' CX010-RF-QUANTITY
    WS-ERROR-CODE = '017'                           
    PERFORM LOG-THE-ERROR                           
END-IF

add the statement:
DISPLAY HEX CX010-RF-QUANTITY
And after the run, look at the output and "cut and paste" it back here.....
Back to top
View user's profile Send private message
hiiamanncy

New User


Joined: 18 Sep 2007
Posts: 9
Location: US

PostPosted: Wed Oct 17, 2007 2:34 am
Reply with quote

Hi the value of Hex for Quantity field in Input file is
thsi was there in my input file
Code:
CHAR 0000000A
ZONE FFFFFFFC
NUMR 00000001

Thanks.
Nancy
Back to top
View user's profile Send private message
hiiamanncy

New User


Joined: 18 Sep 2007
Posts: 9
Location: US

PostPosted: Wed Oct 17, 2007 2:45 am
Reply with quote

Hi I added the
DISPLAY HEX CXS010-RF-QUANTITY

stmt in my code and I got this output:

Code:
CHAR 000000A               
ZONE FFFFFFC               
NUMR 0000001               
     1...5..               

NANCY-RF-QUANTITY: 1
NANCY1-RF-QUANTITY: 1

Thanks.
NAncy
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Oct 17, 2007 3:04 am
Reply with quote

I know this is stretching a bit, but try your test after defining your data as:
Code:
CX010-RF-QUANTITY                      149  7    N 0              +   
                                       MASK 'ZZZZZZZ-'
If it works, I'll let you know what I think it was....
Back to top
View user's profile Send private message
hiiamanncy

New User


Joined: 18 Sep 2007
Posts: 9
Location: US

PostPosted: Wed Oct 17, 2007 3:10 am
Reply with quote

yeah it works fine now....I'm glad...

But why do 0 is req if its not a decimal field.

Thanks a ton to all
Nancy
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: Wed Oct 17, 2007 3:15 am
Reply with quote

Hi Nancy,

Good to hear it is working icon_smile.gif

Now, when Bill explains the magic. . .
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Oct 17, 2007 3:26 am
Reply with quote

The Fine Manual wrote:
{N}—zoned decimal — the field contains digits 0 through 9 in external decimal form (that is, 0 = X'F0').

If you specify a numeric field with decimal positions (0 to 18), CA-Easytrieve/Plus considers it a signed (quantitative) field. The following rules apply to signed fields:
2. For non-negative, zoned decimal numbers on the left side of an Assignment statement, CA-Easytrieve/Plus sets an F sign. Otherwise, it manipulates the number in packed decimal format.

If you specify a numeric field with no decimal positions, CA-Easytrieve/Plus considers that field unsigned (non-quantitative) and the following rules apply:
2. Both zoned decimal and packed decimal fields follow the same rules. CA-Easytrieve/Plus packs all zoned decimal fields and handles them as packed decimal fields. CA-Easytrieve/Plus uses the actual storage value in the field, but it is your responsibility to maintain a positive sign. An F sign is placed in any unsigned field on the left side of an Assignment statement.
Your field was signed, your definition was not, thus, it displayed OK, but it had "non-numeric" values for an unsigned data field....

By the way, do you have access to the EZT manuals?
Back to top
View user's profile Send private message
hiiamanncy

New User


Joined: 18 Sep 2007
Posts: 9
Location: US

PostPosted: Wed Oct 17, 2007 4:21 am
Reply with quote

ok....got it....thanks...I'm a beginner in Ezt...

I have access to manuals but I couldn't find easytrieve manuals...

Thanks.
Nancy
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Oct 17, 2007 4:38 am
Reply with quote

Assuming your shop is licensed, contact CA support and ask for a copy of both...
Until then, I found these links on the web:
Language Reference Guide
Programmer Guide
Back to top
View user's profile Send private message
hiiamanncy

New User


Joined: 18 Sep 2007
Posts: 9
Location: US

PostPosted: Wed Oct 17, 2007 7:42 am
Reply with quote

ok...yes I checked ...Easytrieve manuals are avaialable...
Thanks.
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
Search our Forums:

Back to Top