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
 
Better Varibles usage

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

New User


Joined: 14 Feb 2009
Posts: 2
Location: TCS Towers

PostPosted: Sun Feb 15, 2009 12:19 pm    Post subject: Better Varibles usage
Reply with quote

Hello,
We can have two kind of inputs DEHAM,NUE(could be 3 or 5 alphanumeric) and output should be HAM, NUE(always 3 alphanumeric).

Do we have some some better way to do it except moving NUE it to temp alphanumeric variable of X(3) + X(2) and checking the last two chars.

Thanks in advance.
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Sun Feb 15, 2009 6:31 pm    Post subject: Reply to: Better Varibles usage
Reply with quote

You can use reference modification, no need for REDEFINE or extra temp areas:
Code:
IF INP-AREA (4:2) = SPACES THEN            if 2 spaces on right
    MOVE INP-AREA (1:3) TO OUT-AREA           take left part of word
ELSE                                       else
    MOVE INP-AREA (3:3) TO OUT-AREA           take right part of word
END-IF
Is this what you meant ?
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: Mon Feb 16, 2009 6:25 am    Post subject:
Reply with quote

Hello and welcome to the forum,

Suggest you post a more complete definition of the requirement. What you posted is not enough. You need to show more somplete sample records that demonstrate what you may have as input and the output you want from that exact imput. These do not need to be whole records, but enough to show your requirement - particularly the field you mention and the following few fields.

As Marso mentioned, reference modification may be part of your solution but i believe more is also needed. Impossible to say without more complete info. . .
Back to top
View user's profile Send private message
Virender Kumar Midha

New User


Joined: 14 Feb 2009
Posts: 2
Location: TCS Towers

PostPosted: Tue Feb 17, 2009 1:35 pm    Post subject: INP-AREA(4:2) Subscript does not work here
Reply with quote

Hello,
But the subscipts INP-AREA(4:2) does not work in the COBOL we have.
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: Tue Feb 17, 2009 8:55 pm    Post subject:
Reply with quote

Hello,

Quote:
But the subscipts INP-AREA(4:2) does not work in the COBOL we have.
Reference modification is not the same as a subscript. If this field is part of an occurs, the syntax is wrong.

Which compiler is used on your system? Yhe first line of compiler output should show this.

Post the error message including the message id from the compile. Post the definition of INP-AREA and the group it belongs to.

As mentioned earlier, you need to better define the requirement with example input/output.
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 )SEL and )ENDSEL usage cvnlynn TSO/ISPF 4 Thu Jun 15, 2017 1:15 am
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts How can amount of the Storage Usage b... esduman61 CICS 6 Wed Mar 09, 2016 1:19 pm
No new posts Controlling usage of resources by tasks raja1128 CICS 3 Fri Nov 06, 2015 9:53 am
No new posts TDQ & its usage as ATI akodakka CICS 3 Sat Oct 17, 2015 6:04 pm

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