MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sorting requirement

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
naveen
Beginner


Joined: 03 Dec 2002
Posts: 90
Topics: 31

PostPosted: Mon Sep 01, 2003 12:31 am    Post subject: Sorting requirement Reply with quote

I am having following records in a sequential file of record length 80:

F23015306RC 0000000000106510651000100000 0 0 C100
F23015306RC 002002009AB00XY0**0000648 1 2 XYZ0
F23015306RC 0020020000106510651000100000 0 0 C100
F23015306RC 0030030000106510651000100000 0 0 C100
F23015306RC 002002009AB00XY0**0000648 1 2 XYZ0
F23015306RC 0040040000106510651000100000 0 0 C100

I want the output as :

F23015306RC 0000000000106510651000100000 0 0 C100
F23015306RC 002002009AB00110**0000648 1 2 XYZ0
F23015306RC 002002009AB00220**0000648 1 2 XYZ0
F23015306RC 002002009AB00330**0000648 1 2 XYZ0
F23015306RC 002002009AB00440**0000648 1 2 XYZ0
F23015306RC 0020020000106510651000100000 0 0 C100
F23015306RC 0030030000106510651000100000 0 0 C100
F23015306RC 002002009AB00110**0000648 1 2 XYZ1
F23015306RC 002002009AB00220**0000648 1 2 XYZ1
F23015306RC 002002009AB00330**0000648 1 2 XYZ1
F23015306RC 002002009AB00440**0000648 1 2 XYZ1
F23015306RC 0040040000106510651000100000 0 0 C100

i.e. For each record which is having XY at position 28 should be replaced by 4 consecutive records having XY replaced by 11 ,22,33 and 44 respectively. Other records should appear as they are in input.
.
Back to top
View user's profile Send private message Send e-mail
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon Sep 01, 2003 3:47 am    Post subject: Reply with quote

Naveen,

The following job should give you the results...

Code:

//STEP1    EXEC PGM=ICETOOL
//IN       DD *
  F23015306RC 0000000000106510651000100000 0 0 C100
  F23015306RC 002002009AB00XY0**0000648 1 2 XYZ0
  F23015306RC 0020020000106510651000100000 0 0 C100
  F23015306RC 0030030000106510651000100000 0 0 C100
  F23015306RC 002002009AB00XY0**0000648 1 2 XYZ0
  F23015306RC 0040040000106510651000100000 0 0 C100
/*
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//T1       DD DSN=&T1,UNIT=SYSDA,SPACE=(TRK,(1,1))
//T2       DD DSN=&T2,UNIT=SYSDA,SPACE=(TRK,(1,1))
//CON      DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,DELETE)
//         DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,DELETE)
//OUT1     DD SYSOUT=*
//TOOLIN   DD *
  COPY FROM(IN)            USING(CTL0)
  SORT FROM(CON) TO(OUT1)  USING(CTL1)
/*
//CTL0CNTL  DD *
  INREC FIELDS=(1,80,SEQNUM,8,ZD)
  OUTFIL FNAMES=T1,INCLUDE=(28,2,CH,EQ,C'XY'),
  OUTREC=(1,27,C'11',30,59,/,1,27,C'22',30,59,/1,27,C'33',30,59,/,
          1,27,C'44',30,59)
  OUTFIL SAVE,FNAMES=T2
/*
//CTL1CNTL  DD *
  SORT FIELDS=(81,8,CH,A)
  OUTREC FIELDS=(1,80)
/*
//


Hope this helps...

Cheers,
Coolman.
________
Cheap Gamo Rocket Grains Ballistic 150Ct
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group