IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

IMS UNLOAD & REFORMAT using sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dsridhar

New User


Joined: 18 Apr 2005
Posts: 5

PostPosted: Tue Apr 19, 2005 12:00 am
Reply with quote

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
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Apr 19, 2005 1:10 am
Reply with quote

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.
Back to top
View user's profile Send private message
dsridhar

New User


Joined: 18 Apr 2005
Posts: 5

PostPosted: Tue Apr 19, 2005 5:47 pm
Reply with quote

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
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Apr 19, 2005 8:09 pm
Reply with quote

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):

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
   OPTION COPY
   INREC IFTHEN=(WHEN=(11,5,CH,EQ,C'SOBRT'),BUILD=(1,75,C'0',77:76))
/*


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:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
dsridhar

New User


Joined: 18 Apr 2005
Posts: 5

PostPosted: Tue Apr 19, 2005 11:57 pm
Reply with quote

Thats GR8
Am really grateful. i cannot try this today. But will try during the WE & if i get problems i will ask you again
many thanks
deepa
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Load new table with Old unload - DB2 DB2 6
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Remote Unload of CLOB Columns DB2 6
Search our Forums:

Back to Top