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
 

 

How to copy the data from a VSAM file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
pnkumar
Warnings : 2

New User


Joined: 27 Oct 2005
Posts: 24

PostPosted: Tue Aug 05, 2008 7:51 am    Post subject: How to copy the data from a VSAM file
Reply with quote

Hi,
My requirement is like this. I have a VSAM fle having a length of 2500 and is a FB. Now the file length is changed to 3000 with some addition of the filler and some offset changes, i mean upto the length of 1500 the record layout is same and after that 15 new fields are added with a length of 300 bytes and remaing length of 200 has been added as a filler at the end of the record.

Now i want to copy the data from old file (2500 length) to the new file with first 1500 bytes of old file to the first 1500 of new file then initialize the new fileds and again copy the remaining 1000 bytes of old file to new file starting from positon 1801 (1500+300), and the last 200 bytes will also be initialized.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Aug 05, 2008 10:22 pm    Post subject:
Reply with quote

Huh? It's not clear from your description what the output records will look like. You talk about initializing fields but you don't say what they should be initialized to. And it's not clear which input fields go where in the output record. It would help if you'd show a layout something like this:

Output Record

1-1500: Input positions 1-1500
1501-1800: initialized to ?
1801-?

But show it as you really want it.
Back to top
View user's profile Send private message
pnkumar
Warnings : 2

New User


Joined: 27 Oct 2005
Posts: 24

PostPosted: Thu Aug 07, 2008 8:39 am    Post subject:
Reply with quote

The layout is like this

Input file
1-2500 : having numeric and alpha numeric fields

Output file

1-1500: Input positions 1-1500
1501-1800: initialized to zeroes if the field is numeric and initialized with spaces if the field is alphanumeric, for example the position 1501 to 1510 is a numeric field then it should be initialized to zeroes and if 1511-1540 is an alphanumeric then it should be initialized to spaces and again if 1541-1555 and 1556-1569 having numeric fields then it should be initialized to zeroes, like this based on offset it should be initialized to zeroes or spaces.
1801-2800 : Input positions 1501-2500
2801-3000 : Initialized to spaces.

Thanks
Nagaraja
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: Thu Aug 07, 2008 8:55 am    Post subject:
Reply with quote

Hello,

Quote:
initialized to zeroes if the field is numeric and initialized with spaces if the field is alphanumeric
The sort will not detect field type - you must define the fields.

As you use OVERLAY or BUILD to create the output, you may put spaces, zeros, or any other value in each field of the output data.

This previous topic should have info and links to documentation that will help:
http://ibmmainframes.com/viewtopic.php?t=23511

Once you begin to format/initialize your output fields, there may be questions or errors encountered. Post your code, what you are trying to do at that point, and what question or error you encounter.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 08, 2008 2:01 am    Post subject:
Reply with quote

Nagaraja,

The information you've supplied is too vague. I don't know what your fields look like or how they are defined exactly. I can only tell you that you can do the kind of thing you're asking about using DFSORT's IFTHEN function. The DFSORT control statements might look something like this, but you'd have to fill in the specifics:

Code:

    OPTION COPY                                           
    RECORD TYPE=F
    INREC IFTHEN=(WHEN=INIT,OVERLAY=(2801:200X)),       
          IFTHEN=(WHEN=(1501,10,FS,EQ,NUM),             
              OVERLAY=(1501:10C'0'),HIT=NEXT),           
          IFTHEN=(WHEN=(1501,10,FS,NE,NUM),             
              OVERLAY=(1501:10X),HIT=NEXT),             
          IFTHEN=(WHEN=(1511,30,FS,EQ,NUM),             
              OVERLAY=(1501:30C'0'),HIT=NEXT),           
          IFTHEN=(WHEN=(1511,30,FS,NE,NUM),             
              OVERLAY=(1501:30X),HIT=NEXT),
          ...               
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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