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

Replacing the data in a dataset using another dataset


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Fri May 21, 2010 8:04 pm
Reply with quote

Hi All,

My requirement is to replace the 15 characters from position 20 to 35 in dataset A , using the first 15 characters from dataset B.

I want to do it in Eazytrieve.Could you please help me out with this.

Thanks,
manish
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri May 21, 2010 8:10 pm
Reply with quote

1. Positions 20 to 35 include 16 characters, not 15.
2. Is this a one-to-one replacement? If so, what happens if the record counts in the two files are not the same?
3. If it is not a one-to-one replacement, what are the rules governing the replacement?
4. How many records are you wanting to update in dataset A?
Back to top
View user's profile Send private message
manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Fri May 21, 2010 8:17 pm
Reply with quote

Hi Robert,

Sorry for that.It is from position 20 to 34.and it is simple replacement that is suppose the file A has Account number that is of 15 digit with the account numbers from the file B.It has total 3500 records.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri May 21, 2010 8:25 pm
Reply with quote

So file A has 3500 records and file B has 3500 records? If not, you need to specify how the replacement is supposed to work.
Back to top
View user's profile Send private message
manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Fri May 21, 2010 8:29 pm
Reply with quote

yes Robert.both the files has 3500 records.and there is no selection criteria while coying the data.
Back to top
View user's profile Send private message
manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Fri May 21, 2010 8:58 pm
Reply with quote

Hi Robert,

I even tried using BOUNDS command.It is setting the boundries in dataset A but while copying the data from dataset B , the boundries are not working and the data is getting pasted from column first only.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri May 21, 2010 10:13 pm
Reply with quote

Hello,

You do realize that if you use Easytrieve, you will create a 3rd file. . .

You will not change the content of the existing file. You might rename later, but the process will not change the existing data on-the-fly.
Back to top
View user's profile Send private message
manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Sat May 22, 2010 6:38 pm
Reply with quote

Thnx Dick.I got your point.I will try to create a 3rd file then and if at i am able to create it will update all.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat May 22, 2010 9:57 pm
Reply with quote

You're welcome - good luck icon_smile.gif

Someone will be here if there are questions,

d
Back to top
View user's profile Send private message
manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Sat May 22, 2010 10:06 pm
Reply with quote

Hi All,

I am still trying to do it using Easytrieve.
But in the meanwhile i learnt using OVERLAY in File aid and successfully copied according to my requirement.I will still be trying it using eazytrieve.

Thanks All
Back to top
View user's profile Send private message
manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Mon May 24, 2010 5:19 pm
Reply with quote

HI All,

I tried doing the above task using Eztrieve.Though its replacing the data in output but not the way i want.
There are 3439 records in File A.I appended these into the file B.So now file B is having 6478 records in total.After this i used the below Eztrieve code :
Code:

FILE  INPFILE1 VB(255 0)                       
     IN-REC1                           1 255   A
      CASLOG1                          1 15    A
FILE  OUTFILE  FB(250 0)                       
      REC2                             1  250 A
      OUT-REC                          1  1    A
      OUT1                             1  6    A
      CASLOG01                         22 227  A
      CASLOG02                         7  15   A
FILE  OUTFILE1 FB(250 0)                           
      REC3                             1  250 A     
      OUT-REC3                         1  1    A   
      OUT2                             1  6    A   
      CASLOG04                         22 227  A   
      CASLOG03                         7  15   A   
      CM1                           W  250 A VARYING
      CM2                           W  250 A VARYING
      CM3                           W  250 A VARYING
=======================================*           
JOB INPUT OUTFILE                                   
DO WHILE NOT EOF OUTFILE                           
  IF OUT-REC = 'C'                                 
   MOVE OUT1 TO CM2                                 
   MOVE CASLOG01 TO CM3                             
  END-IF                                           
  IF OUT-REC = ' '                                 
   MOVE CM2 TO OUT2                                 
   MOVE CASLOG02 TO CASLOG03                       
   MOVE CM3 TO CASLOG04                             
   PUT OUTFILE1                                     
  END-IF                                           


After running this my OUTFILE1 is having 3439 recrods which are blank and next 3439 records with the replaced data but repeating the last recrod from OUTFILE.

Please let me know if my query is clear to you or not.

Thanks
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon May 24, 2010 7:02 pm
Reply with quote

Hello,

Looks like that is exactly what you coded. . .

What is the purpose of cm1, cm2, and cm3?

Suggest you adopt better naming methods. . . One does not usually read outfile. . . One does not usually name an INFILE that is not used either. . .

You need to post some sample input records and the output you want from these input records. Use short records that demonstrate what you want to do.
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
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Store the data for fixed length COBOL Programming 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top