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
senthamizh
Posts: 5
Joined: Tue Sep 14, 2010 2:44 pm
Skillset: MVS assembler,JCL,COBOL
Referer: website

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

User avatar
sergeyken
Posts: 458
Joined: Wed Jul 24, 2019 10:12 pm
Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
Referer: Internet search

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

Code: Select all

Ws-ID x(30)

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

For example
1.

Code: Select all

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.

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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.


  • Similar Topics
    Replies
    Views
    Last post