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
 

 

Is there any values that are less than Spaces

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
chaitanyav

New User


Joined: 13 May 2008
Posts: 3
Location: Hyderabad

PostPosted: Thu Jan 21, 2010 12:42 pm    Post subject: Is there any values that are less than Spaces
Reply with quote

Hi All,

Can any one tell me what are the values that are less than Spaces and Greater than Low-Values

I have the following logic in one of my programs that I need to test. I am confused about the values.

Please find the below logic.

Working storage Section.
-----------------------------
01 WW-TEST-COND.
05 WW-CADEAU PIC S9(7)V99 COMP-3.
05 WW-CADEAU-R REDEFINES WW-CADEAU.
07 WW-CADEAU-X PIC X(5).

Linkage Section:
-------------------
01 WL-LINKAGE.
03 WL-LINKAGE-LENGTH PIC S9(04) COMP.
03 WL-PARMS.
05 WL-JOB-NAME PIC X(7).

Procedure Division.
--------------------------
IF WW-CADEAU-X < SPACES
AND WW-CADEAU-X > LOW-VALUES
IF WW-CADEAU > 0 OR < 0
DISPLAY 'Test Condition'
DISPLAY 'WW-CADEAU - ' WW-CADEAU
END-IF
DISPLAY 'WW-CADEAU-X : ' WW-CADEAU-X
END-IF

When I am moving values to WW-TEST-COND thru the JCL parms like the below I am entering into that loop and when I check the spool the display is showing as spaces (I mean I cann't see any values in SYSOUT for WW-CADEAU-X).

JCL:
----
PARMS (12345&&)

Note: &&-->indicates Spaces
------
The way I am passing the parms is not correct as I delcared the linkage for this as mentioned above and the correct way is PARMS('12345&&').

When I am trying to use the below condition in the above code I am getting S0C7.
IF WW-CADEAU > 0 OR < 0

But still I am not getting how it entered into the loop for the first IF condition (IF WW-CADEAU-X < SPACES
AND WW-CADEAU-X > LOW-VALUES ).
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Thu Jan 21, 2010 6:00 pm    Post subject:
Reply with quote

LOW-VALUE is hexadecimal (hex) '00'.
SPACE is hex '40' in EBCDIC.
Simple arithmetic tells you there are 62 characters in the EBCDIC collating sequence that are larger than LOW-VALUES and less than SPACES.

Quote:
IF WW-CADEAU > 0 OR < 0
Why not say
Code:
IF  WW-CADEAU NOT EQUAL ZERO
which makes a lot more sense than the code you have. Also note the improvement in readability that using BBcode provides.

You need to click on the manuals link at the top of the page, find the COBOL Language Reference and Application Programming Guide manuals and read them -- cover to cover. If you do so, you will find that the hex value for WW-CADEAU is x'000000000C' which is, indeed, less than SPACES (x'4040404040') and greater than LOW-VALUES (x'0000000000').

If you want the find the collating sequence characters between LOW-VALUES and SPACES yourself, Google is your friend.
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: Thu Jan 21, 2010 9:13 pm    Post subject:
Reply with quote

Hello,

Quote:
I am confused about the values.


Part of your confusion may be due to how things are done on ASCII (Windows, UNIX) systems. In UNIX, there is a term - "working below spaces" - that means the data is most likely some kind of control character rather than user data. On those systems a SPACE is an x'20', so these values are from x'00' thru x'1F'.

If you look at the ebcdic values from x'00' - x'FF' and the ascii values for the same, there is little similarity.

Before using a "user" input value as numeric, you should make sure that it contains valid numeric data.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


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