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
 

 

Need help in Sort [moving fields one level up]

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vimalrajendran

New User


Joined: 27 Oct 2009
Posts: 2
Location: Lynchburg

PostPosted: Thu Dec 10, 2009 1:31 am    Post subject: Need help in Sort [moving fields one level up]
Reply with quote

I have the following scenario:

Input: [Sequential DS]

101 00AA 00BB
101 00CC 00DD
101 00EE 00FF
101 00GG 00HH
201 00II 00JJ
201 00KK 00LL
201 00MM 00NN

I need to add an extra column with the values shifted from the previous record [from 4th byte on],also for every change of value in the first 3 bytes,the process should be restarted as follows:

Output:

101 00AA 00BB 00CC
101 00DD 00EE 00FF
101 00GG 00HH
201 00II 00JJ 00KK
201 00LL 00MM 00NN

Could this be done thru DFSORT/ICETOOL/ICEMAN?

Please send your thoughts.
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: Thu Dec 10, 2009 2:28 am    Post subject:
Reply with quote

What is the RECFM and LRECL of the input file?

What is the starting position, length and format of each input field and each output field?

It appears that you want to change from groupings of two fields for each key to groupings of three fields for each key
(e.g. A B/C D/ E F to A B C/D E F) - is that correct?
Back to top
View user's profile Send private message
vimalrajendran

New User


Joined: 27 Oct 2009
Posts: 2
Location: Lynchburg

PostPosted: Thu Dec 10, 2009 2:52 am    Post subject:
Reply with quote

Hi Frank,
Thanks for the quick response.

The RECFM is FB and the LRECL is 80 Bytes.

I/P Record:
101 00AA 00BB

101 - 1,3,CH [Starting pos,Length,Format]
00AA - 4,4,CH
00BB - 8,4,CH

O/P Record:
101 00AA 00BB 00CC

101 - 1,3,CH
00AA - 4,4,CH
00BB - 8,4,CH
00CC - 12,4,CH

Yes correct,I need to have 3 groupings of 3 fields instead of 2 groupings of 2.

Do let me know if you need any more details.
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: Fri Dec 11, 2009 2:02 am    Post subject:
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD *
10100AA00BB
10100CC00DD
10100EE00FF
10100GG00HH
20100II00JJ
20100KK00LL
20100MM00NN
30100XX00YY
40100ZZ
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(90,8,ZD) -
   WITHEACH WITH(8,4) WITH(12,4) -
   KEEPNODUPS USING(CTL2)
/*
//CTL1CNTL DD *
 OUTFIL FNAMES=T1,BUILD=(1,3,4,4,80:X,/,1,3,8,4)
/*
//CTL2CNTL DD *
 OPTION COPY
 INREC IFTHEN=(WHEN=INIT,
    OVERLAY=(81:SEQNUM,8,ZD,START=0,RESTART=(1,3),
             89:81,8,ZD,MOD,+3,TO=ZD,LENGTH=1)),
   IFTHEN=(WHEN=GROUP,BEGIN=(89,1,ZD,EQ,0),PUSH=(90:ID=8)),
   IFTHEN=(WHEN=(89,1,ZD,EQ,1),OVERLAY=(8:4,4)),
   IFTHEN=(WHEN=(89,1,ZD,EQ,2),OVERLAY=(12:4,4))
 OUTFIL FNAMES=OUT,BUILD=(1,80)
/*
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am


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