Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Query in declaring signed variable in Easytrieve Macro

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Query in declaring signed variable in Easytrieve Macro
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: 1187
Location: Bangalore,India

PostPosted: Tue Oct 16, 2007 11:35 pm    Post subject:
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    Post subject: Reply to: Query in declaring signed variable in Easytrieve M
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

Site Director


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

PostPosted: Wed Oct 17, 2007 1:28 am    Post subject:
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    Post subject: Reply to: Query in declaring signed variable in Easytrieve M
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: 2150
Location: At my coffee table

PostPosted: Wed Oct 17, 2007 1:55 am    Post subject: Re: Reply to: Query in declaring signed variable in Easytrie
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    Post subject: Reply to: Query in declaring signed variable in Easytrieve M
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    Post subject: Reply to: Query in declaring signed variable in Easytrieve M
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: 3158
Location: Tucson AZ

PostPosted: Wed Oct 17, 2007 3:04 am    Post subject: Re: Reply to: Query in declaring signed variable in Easytrie
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    Post subject: Reply to: Query in declaring signed variable in Easytrieve M
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

Site Director


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

PostPosted: Wed Oct 17, 2007 3:15 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Oct 17, 2007 3:26 am    Post subject:
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    Post subject: Reply to: Query in declaring signed variable in Easytrieve M
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: 3158
Location: Tucson AZ

PostPosted: Wed Oct 17, 2007 4:38 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us