|
|
| Author |
Message |
VIGNRSH
New User
Joined: 18 Mar 2007 Posts: 30 Location: India
|
|
|
|
HI,
I have a requirement , where I need to insert a ACC.NO of customer on all his Address lines.
Ex.
I/P records: Lrecl=080.
Cust.Name occurs in first 20bytes. then Customer no- 15 bytes. After this record I have the address lines of Customer , which is varying(ie) the number of records for address for each customer is different.
I/P:
xxxxxxxxxxxxxxxxxxxx999999999999990
address line1 (---extends till 60 bytes) (last 20 bytes are filler)
address line 2
xxxxxxxxxxxxxxxxxxxx999999999999991
address line1
address line2
address line3
xxxxxxxxxxxxxxxxxxxx999999999999992
address line1
address line2
In ouptut my last 20bytes of address lines should have corresponding Acc.No of that customer.
O/P: LRECL same as I/P
xxxxxxxxxxxxxxxxxxxx999999999999990
address line1 (999999999999990)
address line 2 (999999999999990)
xxxxxxxxxxxxxxxxxxxx999999999999991
address line1 (999999999999991)
address line2 (999999999999991)
address line3 (999999999999991)
xxxxxxxxxxxxxxxxxxxx999999999999992
address line1 (999999999999992)
address line2 (999999999999992)
As The address lines occurences are varying for every customer I could not use Sampling method.
Thanks in Advance For your Help. |
|
| Back to top |
|
 |
References
|
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1027 Location: Virginia, USA
|
|
|
|
| What identifies the record with the customer name and the records with the address? |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 691
|
|
| Back to top |
|
 |
VIGNRSH
New User
Joined: 18 Mar 2007 Posts: 30 Location: India
|
|
|
|
It is identified by the Custno from 21byte. or characters from 21st byte and its following 15 bytes , if found numeric could be easily categorised as ACC / Cust No.
In Address lines It is not possible to have or I did not find the 21-36 bytes all numeric as alpahabets does occur in address lines.
I hope this helps |
|
| Back to top |
|
 |
Skolusu
DFSORT Developer
Joined: 07 Dec 2007 Posts: 399 Location: San Jose
|
|
|
|
VIGNRSH,
The following DFSORT/ICETOOL JCl will give you the desired results. I assumed that your input is FB recfm and 80 bytes in length
| Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
XXXXXXXXXXXXXXXXXXXX999999999999990
ADDRESS LINE1 AAAAAAAAAAAAAAAAAAAAAA
ADDRESS LINE2 BBBBBBBBBBBBBBBBBBBBBBB
XXXXXXXXXXXXXXXXXXXX999999999999991
ADDRESS LINE1 CCCCCCCCCCCCCCCCCCCCC
ADDRESS LINE2 DDDDDDDDDDDDDDDDDDDDD
ADDRESS LINE3 EEEEEEEEEEEEEEEEEEEEE
XXXXXXXXXXXXXXXXXXXX999999999999992
ADDRESS LINE1 FFFFFFFFFFFFFFFFFFFFFF
ADDRESS LINE2
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(81,8,CH) -
WITHALL WITH(1,80) KEEPBASE USING(CTL1)
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(21,15,ZD,EQ,NUM),
OVERLAY=(81:SEQNUM,8,ZD,21,15)),
IFTHEN=(WHEN=NONE,
OVERLAY=(89:SEQNUM,8,ZD,
81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
SORT FIELDS=COPY
OUTFIL FNAMES=OUT,IFOUTLEN=80,
IFTHEN=(WHEN=(21,15,ZD,EQ,NUM),BUILD=(01,80)),
IFTHEN=(WHEN=NONE,OVERLAY=(40:89,15))
/*
|
The output from this job is
| Code: |
XXXXXXXXXXXXXXXXXXXX999999999999990
ADDRESS LINE1 AAAAAAAAAAAAAAAAAAAAAA 999999999999990
ADDRESS LINE2 BBBBBBBBBBBBBBBBBBBBBBB 999999999999990
XXXXXXXXXXXXXXXXXXXX999999999999991
ADDRESS LINE1 CCCCCCCCCCCCCCCCCCCCC 999999999999991
ADDRESS LINE2 DDDDDDDDDDDDDDDDDDDDD 999999999999991
ADDRESS LINE3 EEEEEEEEEEEEEEEEEEEEE 999999999999991
XXXXXXXXXXXXXXXXXXXX999999999999992
ADDRESS LINE1 FFFFFFFFFFFFFFFFFFFFFF 999999999999992
ADDRESS LINE2 999999999999992
|
|
|
| Back to top |
|
 |
|
|
|