MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Convert psuedo code to cobol code

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sasidhar001
Beginner


Joined: 09 Oct 2004
Posts: 10
Topics: 4
Location: Bangalore

PostPosted: Mon Sep 17, 2007 10:58 am    Post subject: Convert psuedo code to cobol code Reply with quote

Hi Can anybody translate this sentence in terms of COBOL and tell me:

if <custid> begins with '6'{ This is the sentence to be translated in terms of cobol language}
then
<do processing>
_________________
venkat
Back to top
View user's profile Send private message Yahoo Messenger
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Mon Sep 17, 2007 11:13 am    Post subject: Reply with quote

As long as you mean the first character in the field, and the field is a display type ( e.g. PIC X(05) or PIC 9(05)):

Code:

IF CUSTID(1:1) =  '6'
  <processing>
END-IF
Back to top
View user's profile Send private message
sasidhar001
Beginner


Joined: 09 Oct 2004
Posts: 10
Topics: 4
Location: Bangalore

PostPosted: Mon Sep 17, 2007 11:17 am    Post subject: Reply with quote

Thanks buddy for your help.....

Quote:

If there is any other way do reply.......

_________________
venkat
Back to top
View user's profile Send private message Yahoo Messenger
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Mon Sep 17, 2007 11:36 am    Post subject: Reply with quote

There are probably half a dozen ways to do this. Here's a couple more. Take your pick.

Code:

IF CUSTID > '5' AND CUSTID < '7'
    <processing>
END-IF



Code:

01 IN-WORK-REC.
  05  CUSTID.
    07  CUSTID-1    PIC X(01).
    07  FILLER         PIC X(05).

IF CUSTID-1 = '6'
    <processing>
END-IF



Code:

01 IN-WORK-REC.
  05  CUSTID.
    07  CUSTID-IND  PIC X(01).
     88  PROCESS-CUSTID   VALUE '6'.
    07  FILLER         PIC X(05).

IF PROCESS-CUSTID
    <processing>
END-IF
Back to top
View user's profile Send private message
sasidhar001
Beginner


Joined: 09 Oct 2004
Posts: 10
Topics: 4
Location: Bangalore

PostPosted: Tue Sep 18, 2007 6:27 am    Post subject: Reply with quote

Thanks buddy..................I think the first one is simpler...
_________________
venkat
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group