Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Is it possible to have a variable in a substring

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Fri Nov 14, 2014 4:07 am    Post subject: Is it possible to have a variable in a substring
Reply with quote

Hi ,

Formula => Part1+Part2=Part3

SELECT SUBSTR(Formula ,1,5)

can the above select be put inside loop something like below

Do below untill WS-variable < 15 , increrment WS-variable by 5
SELECT SUBSTR(Formula ,WS-Variable,5)
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2382
Location: NY,USA

PostPosted: Wed Nov 19, 2014 2:59 am    Post subject:
Reply with quote

Use a LOCATE function to get a length/ start point into (WS-Variable) and then do a SubStr.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts COBOL - Array result in single variab... vinu78 COBOL Programming 3 Thu Feb 20, 2020 5:29 pm
No new posts Variable tso ISR Renato Zangerolami TSO/ISPF 4 Fri Feb 07, 2020 7:30 pm
No new posts Variable length(Pipe delimter) to Fix... SreekanthMada DFSORT/ICETOOL 8 Mon Jan 06, 2020 4:44 pm
No new posts Substring for 2 files in Sort JCL Shubhendu Chakraborty DFSORT/ICETOOL 1 Wed Nov 20, 2019 11:07 am
No new posts Substring for 2 files in Sort JCL Shubhendu Chakraborty SYNCSORT 5 Wed Nov 20, 2019 11:04 am

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