Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

command to update or add values to a particuler pos in Vb fi

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
praveenmaga

New User


Joined: 27 Jun 2009
Posts: 6
Location: Bangalore

PostPosted: Fri Nov 13, 2009 2:22 am    Post subject: command to update or add values to a particuler pos in Vb fi
Reply with quote

Is there any command to write values to a particuler position in a VB file?
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: Fri Nov 13, 2009 2:58 am    Post subject:
Reply with quote

Hello,

Suggest you invest some more keystrokes and more completely describe your requirement. . .

Show what the input looks like and how you want the output to be written.

Mention the lrecl and recfm of the files.
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Nov 13, 2009 3:20 pm    Post subject: Reply to: command to update or add values to a particuler po
Reply with quote

There is no need to differentiate VB file from FB in your program. Rexx places the value in the position that you give. This position is what you see in the file by giving cols.

You can use either Insert or Overlay function to place your string in the desired position in your file.

Say if you want to insert a string 'AA' in the fifth column(This is what I assume you meant by a 'particular position')

Code:

"EXECIO * DISKR INPUT (STEM INP. FINIS"
INP.1 = OVERLAY('AA',INP.1,5)         
"EXECIO * DISKW INPUT (STEM INP. FINIS"


The above code will read the file and place 'AA' in the fifth column in the first record.

VB makes difference only when you catalog a dataset using Rexx.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Nov 13, 2009 4:05 pm    Post subject: Re: Reply to: command to update or add values to a particule
Reply with quote

sathyaraj wrote:
VB makes difference only when you catalog a dataset using Rexx.

Can you explain this, as I have never come across any differences in 20+ years of using REXX
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Nov 13, 2009 5:02 pm    Post subject:
Reply with quote

I meant the record format (FB, VB) that we use while creating a new PS file using TSO command Allocate.
Plz correct me if I am wrong.
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Fri Nov 13, 2009 5:23 pm    Post subject:
Reply with quote

sathyaraj wrote:
I meant the record format (FB, VB) that we use while creating a new PS file using TSO command Allocate.
Plz correct me if I am wrong.


And saying that grass is green is just as useful.
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Nov 13, 2009 5:39 pm    Post subject:
Reply with quote

Quote:

And saying that grass is green is just as useful.


Giving an additinal info doesnt gonna cause any harm. Thought it might be usefull to someone who is an alien to REXX. icon_wink.gif
Back to top
View user's profile Send private message
praveenmaga

New User


Joined: 27 Jun 2009
Posts: 6
Location: Bangalore

PostPosted: Fri Nov 13, 2009 9:31 pm    Post subject: Reply to: command to update or add values to a particuler po
Reply with quote

thnx.
Sorry i might have missed this infn in my post.
I don't want to add hard coded values to output file.
it should be like this--
read a input file and take the values from colm 2 to 3
and write to the first record in colm 8 to 10 in the output file.
Back to top
View user's profile Send private message
praveenmaga

New User


Joined: 27 Jun 2009
Posts: 6
Location: Bangalore

PostPosted: Fri Nov 13, 2009 9:48 pm    Post subject: Reply to: command to update or add values to a particuler po
Reply with quote

'EXECIO * DISKR HI (STEM LINES. FINIS'
DO I = 1 TO LINES.0
LINES.I = OVERLAY(LINES.I,2341)
'EXECIO * DISKW HI1 (STEM LINES. FINIS'
END

this is my code..
when i try this...its adding values to the first colums only in output file.
it should read first record and take the value from colm 2 to 3 and write to first record to a colm 7-8...so on,
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: Fri Nov 13, 2009 9:51 pm    Post subject:
Reply with quote

To repeat:
Quote:
Show what the input looks like and how you want the output to be written.
It you had done as requested, you would have saved a day. . .
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Nov 13, 2009 10:12 pm    Post subject:
Reply with quote

Hope this works..

Code:

'EXECIO * DISKR HI (STEM LINES. FINIS' 
'EXECIO * DISKR HI1 (STEM LINES1. FINIS' 
DO I = 1 TO LINES.0                     
INP = SUBSTR(LINES.I,2,2)               
LINES1.I = OVERLAY(INP,LINES.I,7)       
END                                     
'EXECIO * DISKW HI1 (STEM LINES1. FINIS'


Assuming your input and output file has different data.. you just want to take field in position 2-3 in input and overlay it in position 7-8 in output and that you have equal number of input and output records.
Back to top
View user's profile Send private message
praveenmaga

New User


Joined: 27 Jun 2009
Posts: 6
Location: Bangalore

PostPosted: Fri Nov 13, 2009 10:39 pm    Post subject: Reply to: command to update or add values to a particuler po
Reply with quote

Code:

/* REXX */
...
'EXECIO * DISKR HI (STEM LINES. FINIS'                           
DO I = 1 TO LINES.0                                               
  N = SUBSTR(LINES.I,1,5)                                           
  SAY N                                                             
  LINES.I = OVERLAY(N,LINES.I,2341)                   
END         
'EXECIO * DISKW HI1 (STEM LINES. FINIS'
EXIT     


I ran with this code now as you said... its overlaying at 2341 colm..also its overlaying in the starting colm 1. please advice.
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Nov 13, 2009 10:56 pm    Post subject:
Reply with quote

oh man....

It is not overlaying in the column one. you are taking fielnd in position 1-5 and placing in 2341.

so the field will be in 2341 and it will be in column 1 as it is its actual position...

That is the reason I have used different stem in my previous example for input and output. If your output data is different read it into a stem before overlapping.. and overlap the output stem with your substring in the desired position.

Hope this helps.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us