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: 2247
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 Concatenate two files of variable rec... Thiru S DFSORT/ICETOOL 3 Wed Aug 21, 2019 11:53 pm
No new posts Move a particular line from a PS file... Jitesh Kumar CLIST & REXX 7 Mon Aug 05, 2019 2:48 am
No new posts Having problem passing a variable to ... markzasz JCL & VSAM 12 Thu Jul 11, 2019 5:31 pm
No new posts position, start pos, length of column... juares castro SYNCSORT 14 Fri Jun 21, 2019 8:47 pm
No new posts How to substring a new dataset name f... javen777 JCL & VSAM 6 Tue Feb 19, 2019 12:00 pm

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