Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move and If

Status
Not open for further replies.

ashykhanna

Programmer
May 27, 2002
14
IN
hello friends,
i want to know what these lines of code does:

1) MOVE 1180-AMPS-BTCH-DTL-LINE-MSC(1:11) TO 1103-ORD-ID.

2) IF 1180-BTCH-DTL-LINE(12:1) = 'P'
PERFORM 1000-PROCESS
THRU 1000-PROCESS-EXIT.

Thank you,
Ash..
 
The first stament moves the first 11 characters of 1180-AMPS-BTCH-DTL-LINE-MSC to the target field.

the second statement tests if the 12th character of 1180-AMPS-BTCH-DTL-LINE-MSC is equal to 'p'.

This is REFERENCE MODIFICATION. Check it out in your manual.

STEPHEN J SPIRO
 
The code is using Reference Modification capability of COBOL to access bytes within a field.

1) MOVE 1180-AMPS-BTCH-DTL-LINE-MSC(1:11) TO 1103-ORD-ID.

The preceding statement is moving the 11 bytes starting in position 1 from 1180-AMPS-BTCH-DTL-LINE-MSC to 1103-ORD-ID.


2) IF 1180-BTCH-DTL-LINE(12:1) = 'P'
PERFORM 1000-PROCESS
THRU 1000-PROCESS-EXIT.

The preceding statement is doing an IF test of position 12 for 1 byte within the field called 1180-BTCH-DTL-LINE. If the 12th position is equal to a 'P' then do the PERFORM.

The ability to do Reference Modification (i.e access bytes or characters within a field) was introduced into COBOL with the ANSI/85 standard.

Hope this helps...


Saginaw
helpdesk@simotime.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top