IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Repeating key of record on its fol'g lines until key changes


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VIGNRSH
Warnings : 1

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Tue Jun 03, 2008 7:31 am
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 03, 2008 7:46 am
Reply with quote

What identifies the record with the customer name and the records with the address?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Jun 03, 2008 8:20 am
Reply with quote

Hi,

see the following link http://ibmmainframes.com/viewtopic.php?t=29959&highlight=repeat+header


Gerry
Back to top
View user's profile Send private message
VIGNRSH
Warnings : 1

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Tue Jun 03, 2008 8:24 am
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jun 03, 2008 9:38 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top