Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 query to fetch record which has only ... maxsubrat DB2 10 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us