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
 

 

Overlay with WHEN=Group not working

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

New User


Joined: 31 Aug 2007
Posts: 55
Location: bangalore

PostPosted: Wed Oct 21, 2015 4:00 am    Post subject: Overlay with WHEN=Group not working
Reply with quote

Hi,

I am using following sort card to split a block of records into two files
Code:

//SYSIN DD *                                                         
  OPTION COPY                                                         
   INREC IFTHEN=(WHEN=GROUP,                                         
              BEGIN=(16,8,CH,EQ,C'B0135101'),                         
              OVERLAY=(1001,C'1'))                                   
         IFTHEN=(WHEN=GROUP,                                         
              BEGIN=(16,8,CH,EQ,C'B0135102'),                         
              OVERLAY=(1001,C'2'))                                   
   OUTFIL FILES=01,INCLUDE=(1001,1,CH,EQ,C'1'),                       
            BUILD=(1,1000)                                           
   OUTFIL FILES=02,INCLUDE=(1001,1,CH,EQ,C'2'),                       
            BUILD=(1,1000)                                           
   OUTFIL FILES=XX,                                                   
            SAVE,                                                     
            BUILD=(1,1000)                                           
/*   


Here the input file and output files having record length 1000. I am adding an unique identifier '1' or '2' at position 1001 in INREC command to a block of records using group option and in the Out files based on the unique identifier I am writing to two different files.

But my sort card is giving error at Overlay command. Could you please help me to resolve.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Wed Oct 21, 2015 4:34 am    Post subject: Reply to: Overlay with WHEN=Group not working
Reply with quote

If you get an error, post the error message.

OVERLAY is not part of WHEN=GROUP. Use PUSH=with ID=1 (length of one).
Back to top
View user's profile Send private message
krsenthil85

New User


Joined: 31 Aug 2007
Posts: 55
Location: bangalore

PostPosted: Wed Oct 21, 2015 6:12 am    Post subject: Reply to: Overlay with WHEN=Group not working
Reply with quote

Hi Bill,

The GROUP function works but not getting expected result because the Group function perform auto increment after writing one block of record. For example I have input file as below

Code:
00HEADER       B0135101     
70XXXXXXX
70XXXXXXX
99TRAILER
00HEADER       B0135101     
70XXXXXXX
70XXXXXXX
99TRAILER
00HEADER       B0135102     
70XXXXXXX
70XXXXXXX
99TRAILER
00HEADER       B0135101     
70XXXXXXX
70XXXXXXX
99TRAILER
00HEADER       B0135102     
70XXXXXXX
70XXXXXXX
99TRAILER


I want to get only two output files will a block of records containing 'B0135101' in one file and the other one 'B0135102' in the second file. So the output file should be as below

Output File 1
Code:
00HEADER       B0135101     
70XXXXXXX
70XXXXXXX
99TRAILER
00HEADER       B0135101     
70XXXXXXX
70XXXXXXX
99TRAILER
00HEADER       B0135101     
70XXXXXXX
70XXXXXXX
99TRAILER


Output file 2:
Code:
00HEADER       B0135102     
70XXXXXXX
70XXXXXXX
99TRAILER
00HEADER       B0135102     
70XXXXXXX
70XXXXXXX
99TRAILER


Please help
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Wed Oct 21, 2015 11:40 am    Post subject: Reply to: Overlay with WHEN=Group not working
Reply with quote

OK, you didn't describe or show your data previously :-)

If you look, the last digit of your BEGIN value is 1 or 2. Use that last digit to PUSH.
Back to top
View user's profile Send private message
krsenthil85

New User


Joined: 31 Aug 2007
Posts: 55
Location: bangalore

PostPosted: Wed Oct 21, 2015 11:51 pm    Post subject: Reply to: Overlay with WHEN=Group not working
Reply with quote

Ok. In that case it will add '00' for both the groups containing the Key B0135101 and B0135102, since Header record for both starts with '00'. But I want to add different Group number for each set of group, then only I can write each group of record in separate file. Example I need something like below



Code:
00HEADER       B0135101             001
70XXXXXXX
70XXXXXXX
99TRAILER
00HEADER       B0135101             001
70XXXXXXX
70XXXXXXX
99TRAILER
00HEADER       B0135101             001
70XXXXXXX
70XXXXXXX
99TRAILER


00HEADER       B0135102             002
70XXXXXXX
70XXXXXXX
99TRAILER
00HEADER       B0135102             002
70XXXXXXX
70XXXXXXX
99TRAILER


Assuming last three character are PUSH record. Please help.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Oct 22, 2015 4:49 am    Post subject: Reply to: Overlay with WHEN=Group not working
Reply with quote

This is a value: B0135101. This is the other: B0135102.

Those end in 1 and 2 respectively. You want 1 and 2 appended, respectively. So PUSH the final digit of that value.

I've no clue how you got the idea of using the record-type. Since it is the same for both your selection values, I don't see how you could have even imagined that would help.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu Oct 22, 2015 6:10 am    Post subject: Reply to: Overlay with WHEN=Group not working
Reply with quote

You don't need to create groups separately. You just need to identify each of them.
Code:
    OPTION COPY
    INREC IFTHEN=(WHEN=GROUP,
               BEGIN=(1,8,CH,EQ,C'00HEADER'),PUSH=(1001:16,8))
    OUTFIL FILES=01,INCLUDE=(1001,8,CH,EQ,C'B0135101'),
             BUILD=(1,1000)
    OUTFIL FILES=02,INCLUDE=(1001,8,CH,EQ,C'B0135102'),
             BUILD=(1,1000)
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Oct 22, 2015 1:04 pm    Post subject: Reply to: Overlay with WHEN=Group not working
Reply with quote

That could include RECORDS=4 (each group is shown in the example with four records) or END= for the 99 (if the groups actually aren't regular). Don't need to test the HEADER part, just the record-type.
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 abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
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 SCRNAME not working on my mainframe? mrsidhu12 TSO/ISPF 7 Thu Sep 01, 2016 2:17 pm
No new posts Select first 2 group data vice_versa DFSORT/ICETOOL 10 Mon Jun 13, 2016 2:21 pm
No new posts 2 same CLIST pgm but with different n... boyti ko CLIST & REXX 5 Fri Jun 03, 2016 4:55 pm


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