Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
UNSTRING without a delimiter

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Mon Nov 26, 2007 4:33 pm    Post subject: UNSTRING without a delimiter
Reply with quote

Hi All,

I have a numeric field of 1594 characters in length. I want to delimit that string into different fields each of length 9 characters. In short I want split the field of lenth 1594 into different fields each of length 9 characters. How can I achieve this, Can I do this using 'UNSTRING', or is there any other way to achieve this? Please advice,..

Thanks and Regards,
Sakthi.
Back to top
View user's profile Send private message

rpuhlman

New User


Joined: 11 Jun 2007
Posts: 80
Location: Columbus, Ohio

PostPosted: Mon Nov 26, 2007 5:16 pm    Post subject:
Reply with quote

Ok ... First thing ... you can not have a numeric field length of 1594 ... 18 or 31 is the max depending on your compiler options. Since I do not know what the requirements are for your request, all I can give you is a best guess ... and no, you do not need the UNSTRING statement to accomplish your task. Simply define a group level element that will redefine the 1594 byte element. As an example:
Code:
01  WS-GROUP-ELEMENT.
    03  WS-FIELD-1594            PIC  X(1594).
    03  WS-FIELD-AREA REDEFINES WS-FIELD-1594.
        05  WS-FIELD-ENTRIES OCCURS 177 TIMES.
            07  WS-FIELD-ENTRY   PIC  X(09).
        05  WS-FIELD-EXTRA-BYTE  PIC  X(01).


1594/9 = 177.1111111 .... So you have 177 nine byte fields with one byte left over. There are other ways to do this and I'm sure others here will give examples and suggestions.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Nov 26, 2007 6:43 pm    Post subject: Re: UNSTRING without a delimiter
Reply with quote

sakthi_ksv wrote:
I have a numeric field of 1594 characters in length. I want to delimit that string into different fields each of length 9 characters. In short I want split the field of lenth 1594 into different fields each of length 9 characters. How can I achieve this, Can I do this using 'UNSTRING', or is there any other way to achieve this? Please advice,..
And yes, you can use UNSTRING without the DELIMETER, the number of chatracters unstrung into each field will depend on the field size.
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Tue Nov 27, 2007 9:36 am    Post subject: Reply to: UNSTRING without a delimiter
Reply with quote

Thanks rpuhlman. Also William Could you please explain how UNSTRING can be used with syntax/example? Becuase I couldnt find any example in the help without a DELIMITER word.

Thanks in advance,
Sakthi.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Nov 27, 2007 12:19 pm    Post subject:
Reply with quote

Hello,

Check here. . .
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3lr10/6.2.39.1?ACTION=MATCHES&REQUEST=unstring&TYPE=FUZZY&SHELF=&DT=20020920180651&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT

The cobol documentation are available via the "Manuals" link at the top of the page.
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Tue Nov 27, 2007 2:43 pm    Post subject:
Reply with quote

Thanks all for the timely Help.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts Problem with UNSTRING of CSV data Bill Woodger COBOL Programming 14 Tue Dec 15, 2015 5:32 pm
No new posts Split into Multiple records based on ... daveporcelan SYNCSORT 2 Wed Mar 11, 2015 8:41 pm
No new posts Replace Data before a delimiter in VB... Trinadh DFSORT/ICETOOL 11 Wed Feb 11, 2015 9:18 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us