I need to unload an IMS DB. 1 of the fields in the root segment is getting changed. The copy code is sort of as below:
01 obrt-rec
05 obrt-key ...
05 obrt-others.
....
05 obrt-fld pic 99.
...
05 fillerpic pic x(10).
I am going to reduce the filler by 1 byte & expand the obrt-fld by 1 byte.
I intend doing this using SORT in the following manner. Is there a simpler way.
a. Copy all the segments with a
SORT FIELDS=(COPY)
INREC FIELDS=(1::SEQNUM,10,ZD,11:1)
RECORD TYPE=V
this is to maintain uniqueness
b. include only obrt SEGMENT
o/p: tsobrt
& reformat with 0 prefix in obrt-fld1
c. OMIT SOBRT the rest of the segments :&&Tnotobrt
d. combine & sort TSOBRT and TNOTOBRT by 10 byte seq no. & drop it off in the OUTREC
SORT FIELDS=(1,10,ZD,A)
OUTREC FIELDS=(1:11)
RECORD TYPE=V
use this to load the db
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
It's hard to tell what you're trying to do from your description, but I can tell you that the control statements you show are incorrect because you are not taking the 4-byte RDW into account. They should be:
Code:
SORT FIELDS=COPY
INREC FIELDS=(1,4,5:SEQNUM,10,ZD,15:5)
RECORD TYPE=V
and:
Code:
SORT FIELDS=(5,10,ZD,A)
OUTREC FIELDS=(1,4,5:15)
RECORD TYPE=V
I can't comment on the rest of what you're proposing because I don't understand your description. Perhaps if you showed an example of what your input records look like and what you want the output records to look like, I could help more.
Sorry ... i was in a sort of hurry. I forgot the rdw I will take care of it.
Consider the i/p as below:
.?...?SOBRT ....................?..?.08302200083022000830220008302200083018000
.?....SOBOS ....................^..?"YYYYYYY
.?...?SOBRT .......................?|10001800083020000830200008302200083018000
.?...?SOBTT ....................89801BALDOCK GARAGE 58 HIGH STREET
.?...?SOBRT ....................?....08302000083020000830200008302200083022000
.?...?SOBTT ....................89801BALDOCK GARAGE 58 HIGH STREET
This is a download of IMS SEGMENTS ALONE say for e.g. i am trying to
wherever .? starts a new record or segment starts. So consider that i want to add 0 prefix before the red ones then i want to know if there is any short cut or i have to do so many sort steps that i had previously listed
I want the o/p back in the same order as the i/p records
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
If you just want to add a '0' where shown in the records that have 'SOBRT', you can use DFSORT's new IFTHEN feature available with z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004). Assuming that 'SOBRT' starts in 11 and you want to add the '0' in 76, you could use this DFSORT job (adjust the positions as necessary):
If you have DFSORT, but you don't have the Dec, 2004 PTF installed, ask your System Programmer to install it (it's free). For complete information on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see: