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
 

 

Replacing the data in a dataset using another dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Replacing the data in a dataset using another dataset
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: 7913
Location: Bellevue, IA

PostPosted: Fri May 21, 2010 8:10 pm    Post subject:
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    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Fri May 21, 2010 8:25 pm    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri May 21, 2010 10:13 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sat May 22, 2010 9:57 pm    Post subject: Reply to: Replacing the data in a dataset using another data
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon May 24, 2010 7:02 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm


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