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

Field check in Cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Wed May 22, 2013 7:15 pm
Reply with quote

Hi all,

I am Using CiCS to get the values from front end and invoking with Cobol.

If the field is 8 bytes field , but the entered value is only 3 bytes field.

How to Identify whether the entered value is 8 bytes field or not?

I would be helpful for your helps.

THanks.
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Wed May 22, 2013 7:20 pm
Reply with quote

Hi,

You can make use of INSPECT TALLYING to check for leading/Trailing Spaces or low-values as per the input data.

After INSPECT check the counter field ,if it's zero then it means all 8 bytes are entered

Regards,
Chandan
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed May 22, 2013 7:25 pm
Reply with quote

Is the front end passing a length for the field? Is the data coming in through FEPI or EXCI or another API?
Back to top
View user's profile Send private message
haimzeevi

New User


Joined: 01 Mar 2010
Posts: 27
Location: Israel

PostPosted: Thu May 30, 2013 6:05 pm
Reply with quote

A few options:
1. If values are received by means of "EXEC CICS RECEIVE MAP", then you have, for each field (defined by means of DFHMDF) the "L"- suffix field, tells you the exact input-length for this field. To extract data, read item #2.

2. When input received any other method: if you need numeric-data from the input, you can issue either an"EXEC CICS BIF DEEDIT" to extract numeric-value from the field, or Cobol's "COMPUTE variable = FUNCTION NUMVAL(input-field)".

For alphanumeric data, follow Chandan.

Good Luck.
Haim Zeevi
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Thu May 30, 2013 8:40 pm
Reply with quote

As noted already you may be able to test the length of the field.

IF MAP-NAME-L = +8
yada-yada-yada
ELSE
something-else
END-IF

05 MAP-NAME-L PIC S9(04) COMP.
05 MAP-NAME-A PIC X(01).
05 MAP-NAME PIC X(##).
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri May 31, 2013 5:47 pm
Reply with quote

shanth555,

you need to answer Robert's question if you want any help.

your discription of the problem is very poor.
The source of the data is important.

since you said front-end, one is (potentially) deluded into thinking that you have some kind of JAVA front-end that feeds data to the mainframe.
if that is the case, people are wasting time trying to provide you solutions
based on BMS.

if you can't get the JAVA kids to modify their program,
so that it performs the necessary edits
and provides data lengths to the back-end
you will have to provide us with the data-layout with which you are working.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
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
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top