Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8201
Location: East Dubuque, Illinois, USA

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: 6970
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
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us