View previous topic :: View next topic
|
Author |
Message |
ipavan
New User
Joined: 12 Jun 2005 Posts: 28 Location: Hyderabad
|
|
|
|
morning i have submitted a program which contains 100 records. i have sorted these records.
in the evening i have run another program which takes the input as 100 records from the morning program and additionally it takes another 40 records as input. The output of this program is a sorted order of the morning 100 records and the other 40 records which i have additionally added in the evening.
Now i want the records which i have given as input in the evening
i.e, the new 40 records. how to retrieve these new 40 records from the sorted file. How to do it with a JCL and a cobol program. |
|
Back to top |
|
|
Prandip
New User
Joined: 04 Mar 2005 Posts: 84 Location: In my tiny cubicle ...
|
|
|
|
... and how do you identify those 40 records? What makes them unique that can logically be used to retrieve them from the larger file? |
|
Back to top |
|
|
ipavan
New User
Joined: 12 Jun 2005 Posts: 28 Location: Hyderabad
|
|
|
|
hi prandip,
i want to know whether we can retrieve the records on the basis of time .
I want here time to be the unique key. I want all the records entered at a specific time. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
What is the starting position, length and format of the time field? What does it look like? |
|
Back to top |
|
|
ajay_tv2003
New User
Joined: 15 Jul 2005 Posts: 2
|
|
|
|
Hi,
If you want to extract only the 40 records u added( assume that the record that u added is starting at 101.)
can be acieved using sort,icetool,iceman and file-aid.
try a simply one using sort.
//sysin dd *
sort fields=copy,skiprec=100
/* |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
Hi Ajay_tv2003
We use Skiprec=n with sort to Skip first n number of records.
So In case of Skiprec=100 it just skip first 100 records.
Pavan wants to extract the recode after merging and sorting the new records.
Regards
Rupesh |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Hi Pavan,
When you sort your records in the morning you can put a timestamp with each record. So that its not difficult to fetch out other 40 (evening one) out of the list of 140 total records.
Use this OUTREC statement to put a timestamp with records.
Code: |
OUTREC FIELDS=(DATE3,TIME1,1,L) |
Here L is the length of the record. Timestamp will be in the format of YYDDDHHMMSS.
There are more formats available for timestamps in DFSORT site. For more info'n check it out.
http://www-03.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/srtmatsm.html
Regards,
Priyesh. |
|
Back to top |
|
|
|