IBM Mainframe Forum Index
Log In
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register

Query regarding copy pasting string

IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Warnings : 1

New User

Joined: 15 May 2006
Posts: 92

PostPosted: Mon Oct 13, 2014 4:14 pm
Reply with quote

I have two files , where one file is having LRECL = 6 (FB) and another file having LRECL = 90 (FB), File 1 has only one record of length 6 bytes and File 2 can have many records ,
My query is , can I put the value in File 1 which is of length 6 bytes into the header record of File 2 at position 5 leaving rest of the record and fields as it is. Example is as below.

FILE1 :length 6

FILE2 :length 90
VOL1                        99999999

Output :
VOL1123456          99999999                   

Can we do it in one step?


Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Mon Oct 13, 2014 5:18 pm
Reply with quote

If your one-record file had something identifiable on, and was a 90-byte record, you could do it with a concatenation and IFTHEN=(WHEN=GROUP and RECORDS=2. Even with no identification, you could do it by generating a sequence number (use more resources that way, though). There's JOINKEYS (more resources).

Or a two-step approach where you generate a symbol/SYMANES for your one-record file, and use the generated symbols on SYMNAMES in the second step. There are examples here. For instance.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours


Similar Topics
Topic Forum Replies
No new posts Cobol code- to find a string in a str... COBOL Programming 3
No new posts DB2: Need helping below DB2 query DB2 13
No new posts DB2 SQL query to read and update data... DB2 12
This topic is locked: you cannot edit posts or make replies. copy file 2 data into file1 for match... DFSORT/ICETOOL 4
No new posts Cobol-db2 : SQL query is running for ... DB2 4
Search our Forums:

Back to Top