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
 

 

IMS UNLOAD & REFORMAT using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: IMS UNLOAD & REFORMAT using sort
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 Moderator


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

PostPosted: Tue Apr 19, 2005 1:10 am    Post subject:
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    Post subject: Re: IMS UNLOAD & REFORMAT using sort
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 Moderator


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

PostPosted: Tue Apr 19, 2005 8:09 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/
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    Post subject: Re: IMS UNLOAD & REFORMAT using sort
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    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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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