Skip last 3 bytes and first 3 bytes of data in cobol



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Skip last 3 bytes and first 3 bytes of data in cobol

Postby senthamizh » Wed Dec 21, 2022 7:26 pm

Hi,
i have a variable with char lenght 30.for example
Ws-ID x(30)
I want to skip the first and last 3 char from the value in ws-id.

For example
1.ws-id = abc123456e1b
The result should be 123456

Can any one suggest how this can be done in cobol
Thanks,
Sen
senthamizh
 
Posts: 5
Joined: Tue Sep 14, 2010 2:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Skip last 3 bytes and first 3 bytes of data in cobol

Postby sergeyken » Wed Dec 21, 2022 10:50 pm

senthamizh wrote:Hi,
i have a variable with char lenght 30.for example
Ws-ID x(30)

I want to skip the first and last 3 char from the value in ws-id.

For example
1.
ws-id = abc123456e1b

The result should be 123456

Can any one suggest how this can be done in cobol


1. Learn how to use the Code button when posting your questions.

2. What do you know about COBOL? Out of 2 short code fragments in your message, none of them is a correct COBOL code.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 408
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times

Re: Skip last 3 bytes and first 3 bytes of data in cobol

Postby Robert Sample » Thu Dec 22, 2022 9:18 am

Reference modification.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post