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 

Alignment of records

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


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Wed May 26, 2004 5:31 pm    Post subject: Alignment of records Reply with quote

Hi
I have a CA7 file that I need to align as below.

Input File

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8---#133
001   Y#RISRUN.......... CA7ADM    04146/1739 04146/1739  Y2KSTART         :001
001   Y#SISRUN.......... CA7ADM    04146/1739 04146/1743  Y2KSTART         :001
001   YDATECHK.......... UNKNOWN   04146/1739 04146/1740  Y2KSTART         :001
002     YAMSD990........ RTP       04146/1810 04146/1814  YDATECHK         :001
003       YCOMU500...... COM       04146/1844 04146/1848  YAMSD990         :001
004         YCOMD500.... COM       04146/1918 04146/1920  YCOMU500         :001
005           YRTPD602.. RTP       04146/1950 04146/1951  YCOMD500         :001
004         YCOMD975.... COM       04146/1918 04146/1923  YCOMU500         :001
003       YRCSD810...... RCS       04146/1844 04146/1848  YAMSD990         :001
004         YCISA680.... CIS       04146/1918 04146/1919  YRCSD810         :001
004         YRCSD811.... RCS       04146/1918 04146/1922  YRCSD810         :001
004         YRCSD815.... RCS       04146/1918 04146/1921  YRCSD810         :001
004         YRTPD603.... RTP       04146/1918 04146/1919  YRCSD810         :001
002     YDATECDS........ UNKNOWN   04146/1810 04146/1812  YDATECHK         :001
003       YRELBMPS...... UNKNOWN   04146/1842 04146/1843  YDATECDS         :001
004         YAMSD001.... CMB       04146/1913 04146/1917  YRELBMPS         :001
005           YAMSE430.. CMB       04146/1947 04146/1951  YAMSD001         :001
006             YAMSE420 CMB       04146/2021 04146/2031  YAMSE430         :001
007             YAMSE520 CMB       04146/2101 04146/2105  YAMSE420         :001
008             YAMSD360 INTDAY    04146/2135 04146/2137  YAMSE520         :001
005           YSMAE071.. SMAC      04146/1947 04146/1951  YAMSD001         :001
005           YSMAZ004.. SMAC      04146/1947 04146/1951  YAMSD001         :001
004         YCISD630.... CIS       04146/1913 04146/1917  YRELBMPS         :001
004         YDNIB480.... DNI       04146/1913 04146/1917  YRELBMPS         :001
005           YABSPROF.. ABS       04146/1947 04146/2001  YDNIB480         :001
006             YABSGOOD ABS       04146/2031 04146/2032  YABSPROF         :001
007             YABSPOST ABS       04146/2102 04146/2128  YABSGOOD         :001
008             YRTPD621 RTP       04146/2158 04146/2202  YABSPOST         :001
009             YPASU403 PAS       04146/2208 04146/2209  YPASU402         :001


Output File
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8---#133
001   Y#RISRUN.......... CA7ADM    04146/1739 04146/1739  Y2KSTART         :001
001   Y#SISRUN.......... CA7ADM    04146/1739 04146/1743  Y2KSTART         :001
001   YDATECHK.......... UNKNOWN   04146/1739 04146/1740  Y2KSTART         :001
002   YAMSD990........   RTP       04146/1810 04146/1814  YDATECHK         :001
003   YCOMU500......     COM       04146/1844 04146/1848  YAMSD990         :001
004   YCOMD500....       COM       04146/1918 04146/1920  YCOMU500         :001
005   YRTPD602..         RTP       04146/1950 04146/1951  YCOMD500         :001
004   YCOMD975....       COM       04146/1918 04146/1923  YCOMU500         :001
003   YRCSD810......     RCS       04146/1844 04146/1848  YAMSD990         :001
004   YCISA680....       CIS       04146/1918 04146/1919  YRCSD810         :001
004   YRCSD811....       RCS       04146/1918 04146/1922  YRCSD810         :001
004   YRCSD815....       RCS       04146/1918 04146/1921  YRCSD810         :001
004   YRTPD603....       RTP       04146/1918 04146/1919  YRCSD810         :001
002   YDATECDS........   UNKNOWN   04146/1810 04146/1812  YDATECHK         :001
003   YRELBMPS......     UNKNOWN   04146/1842 04146/1843  YDATECDS         :001
004   YAMSD001....       CMB       04146/1913 04146/1917  YRELBMPS         :001
005   YAMSE430..         CMB       04146/1947 04146/1951  YAMSD001         :001
006   YAMSE420           CMB       04146/2021 04146/2031  YAMSE430         :001
007   YAMSE520           CMB       04146/2101 04146/2105  YAMSE420         :001
008   YAMSD360           INTDAY    04146/2135 04146/2137  YAMSE520         :001
005   YSMAE071..         SMAC      04146/1947 04146/1951  YAMSD001         :001
005   YSMAZ004..         SMAC      04146/1947 04146/1951  YAMSD001         :001
004   YCISD630....       CIS       04146/1913 04146/1917  YRELBMPS         :001
004   YDNIB480....       DNI       04146/1913 04146/1917  YRELBMPS         :001
005   YABSPROF..         ABS       04146/1947 04146/2001  YDNIB480         :001
006   YABSGOOD           ABS       04146/2031 04146/2032  YABSPROF         :001
007   YABSPOST           ABS       04146/2102 04146/2128  YABSGOOD         :001
008   YRTPD621           RTP       04146/2158 04146/2202  YABSPOST         :001
009   YPASU403           PAS       04146/2208 04146/2209  YPASU402         :001


The second filed in the file is dependent on the value of the first field.
If the First field value is 001 then the second filed will be positioned at 7th column.
If the First field value is 002 then the second filed will be positioned at 9th column.
If the First field value is 003 then the second filed will be positioned at 11th column and so on.
But If the First field value is 006 or grteater then the second filed will be positioned at 17th column.

I need to have all the second field values to be positioned at 7th in the output file. All the OTHER fields should remain in the same position as input file.

Record Format is FBA and Record length is 133.
Is it possible to solve this using SORT?
_________________
Regds,
Somu
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed May 26, 2004 6:12 pm    Post subject: Reply with quote

somuk,

I don't have time to code the entire job , but I will give you the idea

Split the file into 'N' different files based on the schid(001,002,003....)

using outrec remove the spaces for the files

Now concatenate these files together and sort on the seqnum or schid to get the records aligned

ex:
Code:

//TOOLIN  DD *
  COPY FROM(IN)  USING(CTL1)
  SORT FROM(CON) USING(CTL2)
//CTL1CNTL  DD *
  INREC FIELDS=(1,133,SEQNUM,8,ZD)
  OUTFIL FNAMES=T1,INCLUDE=(1,3,CH,EQ,C'002'),
  OUTREC=(1,6,9,125,133:X,134,8)
  OUTFIL FNAMES=T2,INCLUDE=(1,3,CH,EQ,C'003'),
  OUTREC=(1,6,11,123,133:X,134,8)
  OUTFIL FNAMES=T3,INCLUDE=(1,3,CH,EQ,C'004'),
  OUTREC=(1,6,13,121,133:X,134,8)
 ....
//CTL2CNTL  DD *
  SORT FIELDS=(134,8,CH,A)
  OUTREC FIELDS=(1,133)
//*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Wed May 26, 2004 10:27 pm    Post subject: Reply with quote

in ISPF edit:
bnds 7 24;c ' ' '' all;bnds

This can, of course, be done in batch if you need to.
Back to top
View user's profile Send private message Visit poster's website
somuk
Beginner


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Wed May 26, 2004 11:47 pm    Post subject: Reply with quote

Thanks kolusu and semigeezer.
I will try both the options tomarrow.
BTW semigeezer appreciate if you can tell me how we can do this in batch..
_________________
Regds,
Somu
Back to top
View user's profile Send private message Yahoo Messenger
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu May 11, 2006 5:05 pm    Post subject: Reply with quote

With z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006), you can now do this quite easily with DFSORT as shown by the following DFSORT job:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(7:7,18,JFY=(SHIFT=LEFT))
/*


For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTFs, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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