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
 

 

Sort on IMS DB unloads

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Rajasekhar K

New User


Joined: 07 Jul 2009
Posts: 3
Location: India

PostPosted: Fri Jul 31, 2009 5:00 pm    Post subject: Sort on IMS DB unloads
Reply with quote

Hi,

Please anyone help on this.

I am using Sycsort Z/OS 1.3.1 version. I have IMS DB unloads which is VB length(4000).The file have one level1 segment(01) and six level2 segments(02).I want the file to be sorted on the basis of expiry date which is present in the level1 segment(starts-26,4).The file structure is as follows:
Pos 1-2 - Level number (01,02,02…,01,02,02,….)
Pos 3-10 -Segment Name
Pos 11-12 -Length of each segment(variable length)
After Pos 12 - Data
For example: (expiry date format is year month—YYMM)
Input file:
01segment1..xxxxxxxxxxxxx9912xxxxxxxxxxxxxxxxxxx
02segment2..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment3..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment4..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment5..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment6..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
01segment1..xxxxxxxxxxxxx0912xxxxxxxxxxxxxxxxxxx
02segment2..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment3..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment4..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment5..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment6..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
01segment1..xxxxxxxxxxxxx1009xxxxxxxxxxxxxxxxxxx
02segment2..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment3..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment4..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment5..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment6..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The Output should be:
01segment1..xxxxxxxxxxxxx0912xxxxxxxxxxxxxxxxxxx
02segment2..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment3..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment4..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment5..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment6..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
01segment1..xxxxxxxxxxxxx1009xxxxxxxxxxxxxxxxxxx
02segment2..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment3..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment4..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment5..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment6..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
01segment1..xxxxxxxxxxxxx9912xxxxxxxxxxxxxxxxxxx
02segment2..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment3..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment4..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment5..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02segment6..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The sort should be segment level group only like segment 1,2,2,2,2,2,2,segment1,2,2,2,2,2,2 …so on.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2238
Location: @my desk

PostPosted: Tue Aug 04, 2009 12:11 pm    Post subject:
Reply with quote

Rajasekhar K,

Welcome to the forums.

Can you explain how 9912 is coming last in your expected output. When handling 2-digit YY year fields, you need to be sure about how the century part CC has to be expanded before sorting. Are you considering this as 2099?.
Back to top
View user's profile Send private message
Rajasekhar K

New User


Joined: 07 Jul 2009
Posts: 3
Location: India

PostPosted: Tue Aug 04, 2009 12:56 pm    Post subject: Reply to: Sort on IMS DB unloads
Reply with quote

Hi,

Thank you for your reply.

The last year century Never come in the Input file.Input file contains the expiry date as "0010" means 2000-october and "9912" means
2099-december only.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2238
Location: @my desk

PostPosted: Wed Aug 05, 2009 10:44 am    Post subject:
Reply with quote

Rajasekhar K,

The below SYNCTOOL job should work for your requirement.
Code:
//STEP0100 EXEC PGM=SYNCTOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD DSN= Input file  (VB/4000)                           
//T1       DD DSN=&&T1,UNIT=SYSDA,DISP=(,PASS)                     
//OUT      DD DSN= Output file (VB/4000)                           
//TOOLIN   DD *                                                     
 SPLICE FROM(IN) TO(T1) ON(5,8,ZD) WITH(25,3996) WITHALL KEEPBASE -
 USING(CTL1) VLENOVLY                                               
 SORT FROM(T1) TO(OUT) USING(CTL2)                                 
//CTL1CNTL DD *                                                     
 INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,SEQNUM,8,ZD,8X,30,4,5)),       
       IFTHEN=(WHEN=(25,2,CH,EQ,C'01'),                             
       OVERLAY=(5:SEQNUM,8,ZD)),                                   
       IFTHEN=(WHEN=NONE,                                           
       OVERLAY=(13:SEQNUM,8,ZD,5:5,8,ZD,SUB,13,8,ZD,M11,LENGTH=8)) 
//CTL2CNTL DD *                                                     
 OPTION EQUALS                                                     
 SORT FIELDS=(21,4,CH,A)                                           
 OUTREC BUILD=(1,4,25)   
Back to top
View user's profile Send private message
Rajasekhar K

New User


Joined: 07 Jul 2009
Posts: 3
Location: India

PostPosted: Wed Aug 05, 2009 5:34 pm    Post subject: Reply to: Sort on IMS DB unloads
Reply with quote

Hi Arcvns,

Thank you very much.

Its working fine.

Regards,
K.Rajasekhar
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2238
Location: @my desk

PostPosted: Wed Aug 05, 2009 6:45 pm    Post subject:
Reply with quote

You're welcome. icon_smile.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


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