Inserting new data on existing records and limit their amoun



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Inserting new data on existing records and limit their amoun

Postby Caius » Thu Jun 25, 2009 3:29 am

Hi everyone, new guy here!

Its great to find a Mainframe forum, its seems the community is working fine :D

Anyway, i've been experimenting at work with new ways to use JCL, and i find myself stuck now. Let me explain.

I have a dataset, formated with a number of records on a column on the first 10 positions. What i would like to do (using only JCL) is
add records from another dataset NEXT to the ones already there (for example, starting on the 12 position). So it looks sorta like two columns from a Spreadsheet.

I've been trying with IEBGENER (but it overwrites the previous records) and SORT (but i can't find an effective way to do this). Merge wont do the trick, since it will paste the new records below the previous ones, and not next to them.

I would appreciate any ideas on this, or any pointers on where to look. I couldnt find any info on IBM documentation, not even internal or training ones (i work there).

Also, is there a way to limit the amount of records when transferring them from one dataset to another? Like, transferring only the first 10 records (in order to sort them, or use them on the previous step of inserting them)
Caius
 
Posts: 2
Joined: Thu Jun 25, 2009 3:20 am
Has thanked: 0 time
Been thanked: 0 time

Re: Inserting new data on existing records and limit their amoun

 

Re: Inserting new data on existing records and limit their amoun

Postby Frank Yaeger » Thu Jun 25, 2009 3:45 am

Also, is there a way to limit the amount of records when transferring them from one dataset to another? Like, transferring only the first 10 records (in order to sort them, or use them on the previous step of inserting them)


With DFSORT, you can use:

   OPTION STOPAFT=n


to only copy or sort n records.

I've been trying with ... SORT (but i can't find an effective way to do this).


It's not clear from your description exactly what you want to do but I suspect you can use the techniques discussed in one of the following "Smart DFSORT Tricks" document at:

http://www.ibm.com/systems/support/stor ... vs/tricks/

- Join fields from two files record-by-record
- Join fields from two files on a key
- Join records on a key with missing fields
- Create files with matching and non-matching records

If you need more specific help, show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.

Also, If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/servers/storage/supp ... tmpub.html
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Inserting new data on existing records and limit their amoun

Postby Caius » Thu Jun 25, 2009 4:06 am

I'll start looking into it right now! I didn't want a solution right away, but some pointers on where to look. I'm still a lowly operator with a developing passion for JCL :)

Thank you!!! I'll post my results when i find a way, on this post. Maybe i can help someone else looking for this?
Caius
 
Posts: 2
Joined: Thu Jun 25, 2009 3:20 am
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post