| View previous topic :: View next topic |
| Author |
Message |
sasidhar001 Beginner

Joined: 09 Oct 2004 Posts: 10 Topics: 4 Location: Bangalore
|
Posted: Mon Sep 17, 2007 10:58 am Post subject: Convert psuedo code to cobol code |
|
|
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 |
|
 |
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Mon Sep 17, 2007 11:13 am Post subject: |
|
|
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 |
|
 |
sasidhar001 Beginner

Joined: 09 Oct 2004 Posts: 10 Topics: 4 Location: Bangalore
|
Posted: Mon Sep 17, 2007 11:17 am Post subject: |
|
|
Thanks buddy for your help.....
| Quote: |
If there is any other way do reply.......
|
_________________ venkat |
|
| Back to top |
|
 |
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Mon Sep 17, 2007 11:36 am Post subject: |
|
|
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 |
|
 |
sasidhar001 Beginner

Joined: 09 Oct 2004 Posts: 10 Topics: 4 Location: Bangalore
|
Posted: Tue Sep 18, 2007 6:27 am Post subject: |
|
|
Thanks buddy..................I think the first one is simpler... _________________ venkat |
|
| Back to top |
|
 |
|
|
|