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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Repeating key of record on its fol'g lines until key changes
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    Post subject:
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: 1703
Location: Australia

PostPosted: Tue Jun 03, 2008 8:20 am    Post subject:
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    Post subject:
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    Post subject: Reply to: Repeating key of record on its fol'g lines until k
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    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: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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