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
 

 

Field check in Cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Field check in Cobol
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: 269
Location: Mumbai

PostPosted: Wed May 22, 2013 7:20 pm    Post subject: Reply to: Field check in Cobol
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: 7905
Location: Bellevue, IA

PostPosted: Wed May 22, 2013 7:25 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


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