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
 

 

How to update overlay when condition is met.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vpr_118
Warnings : 1

New User


Joined: 07 Apr 2008
Posts: 64
Location: chennai

PostPosted: Wed Jun 25, 2008 11:26 am    Post subject: How to update overlay when condition is met.
Reply with quote

Hi
Please find the details below

My input ps has information as below.

MEMBER NAME xxxx
-------
-------
some date
--------
-------
MEMBER NAME yyyyy
-------
-------
some date
--------
-------
MEMBER NAME zzzzz
-------
-------
some date
--------
-------

I want to search for "MEMBER NAME" get the member name "xxxx" update the same in position 72 to 80. Updation must take place till the next member is encountered.

Ones next "member name" is encountered, -- my next member is "yyyyy". Similarly "yyyyy" Must get fill the same "yyyyy" in 72 to 80 column.

Thanks
Back to top
View user's profile Send private message

ssk1711

New User


Joined: 16 Jun 2008
Posts: 40
Location: bangalore

PostPosted: Wed Jun 25, 2008 12:09 pm    Post subject: Re: How to update overlay when condition is met.
Reply with quote

vpr_118 wrote:
Updation must take place till the next member is encountered.


Can you explain it little more. ( probably with an example )
Back to top
View user's profile Send private message
vpr_118
Warnings : 1

New User


Joined: 07 Apr 2008
Posts: 64
Location: chennai

PostPosted: Wed Jun 25, 2008 1:23 pm    Post subject: Reply to: How to update overlay when condition is met.
Reply with quote

Please see the output as well

My input is
MEMBER NAME xxxx
-------
-------
some date
--------
-------
MEMBER NAME yyyyy
-------
-------
some date
--------
-------

output expected is
72 80
-----------------------------------------+
MEMBER NAME xxxx xxxx
------- xxxx
------- xxxx
some date xxxx
-------- xxxx
------- xxxx
MEMBER NAME yyyyy yyyyy
------- yyyyy
------- yyyyy
some date yyyyy
-------- yyyyy
------- yyyyy
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Jun 25, 2008 9:40 pm    Post subject:
Reply with quote

vpr_118,

The following DFSORT/ICETOOL JCL will give you the desired results. I assumed that your input is 80 bytes FB recfm and the member name stars in pos 13 for 8 bytes

Code:

//STEP0100 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD *                                                     
MEMBER NAME XXXX                                                   
-------                                                             
-------                                                             
SOME DATE                                                           
--------                                                           
-------                                                             
MEMBER NAME YYYYY                                                   
-------                                                             
-------                                                             
SOME DATE                                                           
--------                                                           
-------                                                             
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                     
  SPLICE FROM(IN) TO(OUT) ON(81,8,CH) KEEPNODUPS WITHALL -         
  WITH(1,80) KEEPBASE USING(CTL1)                                   
//CTL1CNTL DD *                                                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),               
  IFTHEN=(WHEN=(1,6,CH,EQ,C'MEMBER'),OVERLAY=(81:SEQNUM,8,ZD,13,8)),
  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,BUILD=(1,72,89,8)                               
/*                                                                 
Back to top
View user's profile Send private message
vpr_118
Warnings : 1

New User


Joined: 07 Apr 2008
Posts: 64
Location: chennai

PostPosted: Thu Jun 26, 2008 7:45 am    Post subject: Reply to: How to update overlay when condition is met.
Reply with quote

HI Skolusu,

Can you explain the below mentioned section as given

//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(81,8,CH) KEEPNODUPS WITHALL -
WITH(1,80) KEEPBASE USING(CTL1)
/*

And, why we are overlaying below WHEN=NONE condition. Are we trying to build from starting postion 89 also. Please explain why?
Why are we buliding 1,72,89,8
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,BUILD=(1,72,89,8)
It will really help me understand the code.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Jun 26, 2008 10:52 pm    Post subject:
Reply with quote

vpr_118,

Run the following job and browse the contents in position 81 thru 96 and it will answer your queries. The splice operator take the header record and appends it to all the records

Code:

//STEP0100 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD *                                                     
MEMBER NAME XXXX                                                   
-------                                                             
-------                                                             
SOME DATE                                                           
--------                                                           
-------                                                             
MEMBER NAME YYYYY                                                   
-------                                                             
-------                                                             
SOME DATE                                                           
--------                                                           
-------                                                             
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                     
  COPY FROM(IN) USING(CTL1)                                         
//CTL1CNTL DD *                                                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),               
  IFTHEN=(WHEN=(1,6,CH,EQ,C'MEMBER'),OVERLAY=(81:SEQNUM,8,ZD,13,8)),
  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                                                 
/*             


Hope this helps...

Cheers
Back to top
View user's profile Send private message
vpr_118
Warnings : 1

New User


Joined: 07 Apr 2008
Posts: 64
Location: chennai

PostPosted: Mon Jun 30, 2008 9:40 am    Post subject: Reply to: How to update overlay when condition is met.
Reply with quote

HI Skolusu,

It was a good learning experience for me. I ran the jcl which you have mentioned. Now i am able to realize how the options in the instream work.

Thanks
Back to top
View user's profile Send private message
vpr_118
Warnings : 1

New User


Joined: 07 Apr 2008
Posts: 64
Location: chennai

PostPosted: Mon Jun 30, 2008 9:47 am    Post subject: Reply to: How to update overlay when condition is met.
Reply with quote

Hi,

But still, can u explain me the below part:

IFTHEN=(WHEN=NONE,OVERLAY=(89:SEQNUM,8,ZD,
81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))

What i understand is, when the condition is satifisfied, sequence number are written in position 89 (+ 8 bytes) . But we have charactes in 89th (+8 bytes) postion.

Also after that the sequence number is 81st position is subtracted from that present in 89th postion.

Please correct me if i am wrong.
Back to top
View user's profile Send private message
Varun Singh

New User


Joined: 01 Aug 2007
Posts: 25
Location: Delhi

PostPosted: Mon Jun 30, 2008 11:42 am    Post subject: Reply to: How to update overlay when condition is met.
Reply with quote

Hi Vpr_118,

Here is what we will get after the none gets executed:-
00000001XXXX
0000000100000001
0000000100000002
0000000100000003
0000000100000004
0000000100000005
00000002YYYYY
0000000200000006
0000000200000007
0000000200000008
0000000200000009
0000000200000010

Quote:
Also after that the sequence number is 81st position is subtracted from that present in 89th postion


Yes you are correct!! icon_smile.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Jul 01, 2008 12:26 am    Post subject:
Reply with quote

vpr_118,

Code:

INREC IFTHEN=(WHEN=INIT,                                 
      OVERLAY=(81:SEQNUM,8,ZD)),

The above statement will put a 8 byte sequence number at the end of every record in the input file in position 81.

Code:

IFTHEN=(WHEN=(1,6,CH,EQ,C'MEMBER'),OVERLAY=(81:SEQNUM,8,ZD,13,8)),


When we encounter the string MEMBER at position 1,we are starting the seqnum once again and also put the 8 bytes of the desired string at the end at pos 89.

Code:

IFTHEN=(WHEN=NONE,OVERLAY=(89:SEQNUM,8,ZD,                       
           81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))                   
                                                       


This is where we exactly get the grouping. This a 2 part explanation. first we start another sequence numbering at pos 89 , but it will skip sequence numbers for the search strings. (when=NONE means that none of the above IF conditions are satisified.)

so for the header record you will not see a seqnum and the next lines are off a by a number. So now subtract these 2 numbers from each other to create the group.

Once we create the grouping then we use SPLICE to the put the header name on all records

Hope this helps...

Cheers
Back to top
View user's profile Send private message
vpr_118
Warnings : 1

New User


Joined: 07 Apr 2008
Posts: 64
Location: chennai

PostPosted: Tue Jul 01, 2008 3:01 pm    Post subject: Reply to: How to update overlay when condition is met.
Reply with quote

Hi Skolusu,

I am able to understand the concept Now.

Finally, we will have the desired string (i.e. string in 13th position when string member is encountered) in 89th position..

Will the string get overlayed in all the lines or records till the next string "member" is encounterd?


1) But when we subtract (for WHEN=NONE condition) we have string in 89th position. Will it ignore the subtraction.?

When i ran this, My output had string in 13th position @ 89th postion in all the lines.

My doubt is when point (1) is encountered...it is trying to overlay 89th postion with seq number. Our string as obtained from previous condition must have got overlayed with sequence number.

But still we have the sequence number @ 89th position.

also when subtraction of the seq numbers in 81st and 89th postion takes place, where does the result gets stored ? in 81st postion or 89th?

Thanks for your reply.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Jul 01, 2008 10:51 pm    Post subject:
Reply with quote

Quote:
Will the string get overlayed in all the lines or records till the next string "member" is encounterd?


The SPLICE operator overlays the string on all the lines with the same group number


Quote:
1) But when we subtract (for WHEN=NONE condition) we have string in 89th position. Will it ignore the subtraction.?


NO The INREC processing is completed before SPLICE takes place. Look at the copy job once again and try to understand it
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 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 Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am


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