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
 
create two/more output records from an input

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Jul 05, 2011 12:05 pm    Post subject: create two/more output records from an input
Reply with quote

Hi all,


I have an requirement to validate a record and generate two/more output records

Input file -
Code:
00123ABC000000000111111NNY
00123ABC000000000222222YNY
00123ABC000000000333333NNY
00123ABC000000000444444NNY
00123ABC000055555555555NNY


Rules,

1. Whenever the field 26 is 'Y' create two records
2. Whenever the field 24 is 'Y' create a record
3. whenever the field (12,2) is non zero and even the 26/24 holds 'Y' build an invalid record

Output should be

Code:
1230000000111111AA0101Y             
1230000000111111AA0202Y             
1230000000222222AA0101Y             
1230000000222222AA0202Y             
1230000000222222AA0303Y             
1230000000333333AA0101Y             
1230000000333333AA0202Y             
1230000000444444AA0101Y             
1230000000444444AA0202Y             
---- INVALID RECORD --- 055555555555


I used the following code but not able to come up with the desired solution

Code:
OUTREC IFTHEN=(WHEN(12,2,CH,EQ,C'00',AND,26,1,CH,EQ,C'Y'), 
       BUILD=(1:3,3,4:C'000',7:14,10,17:C'AA0101',23:C'Y', 
             80:X),HIT=NEXT),                               
       IFTHEN=(WHEN(12,2,CH,EQ,C'00',AND,26,1,CH,EQ,C'Y'), 
       BUILD=(1:3,3,4:C'000',7:14,10,17:C'AA0202',23:C'Y', 
             80:X),HIT=NEXT),                               
       IFTHEN=(WHEN(24,1,CH,EQ,C'Y'),                       
       BUILD=(1:3,3,4:C'000',7:14,10,17:C'AA0303',23:C'Y', 
             80:X),HIT=NEXT),                               
       IFTHEN=(WHEN(12,2,CH,NE,C'00'),                     
       BUILD=(1:C' ---- INVALID RECORD --- ',33:12,12))     


Hope i explained my requirements clearly, if not please let me know what you need to know.

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

gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Jul 05, 2011 3:21 pm    Post subject:
Reply with quote

Try this
Code:

SORT FIELDS=COPY                                             
OUTFIL IFTHEN=(WHEN(12,2,CH,EQ,C'00',AND,26,1,CH,EQ,C'Y',AND,
                    24,1,CH,EQ,C'Y'),                         
        BUILD=(1:3,3,4:C'000',7:14,10,17:C'AA0101',23:C'Y',   
             80:X,/,1:3,3,4:C'000',7:14,10,17:C'AA0202',     
             23:C'Y',80:X,/,                                 
             1:3,3,4:C'000',7:14,10,17:C'AA0303',23:C'Y',     
             80:X)),                                         
       IFTHEN=(WHEN(12,2,CH,EQ,C'00',AND,26,1,CH,EQ,C'Y',AND,
                    24,1,CH,NE,C'Y'),                         
        BUILD=(1:3,3,4:C'000',7:14,10,17:C'AA0101',23:C'Y',   
             80:X,/,1:3,3,4:C'000',7:14,10,17:C'AA0202',     
             23:C'Y',80:X)),                                 
       IFTHEN=(WHEN(12,2,CH,NE,C'00'),                       
        BUILD=(1:C' ---- INVALID RECORD --- ',33:12,12))     
                                                             


Also you have missed to include
Code:
SORT FIELDS=COPY
in the above card.
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Jul 05, 2011 3:56 pm    Post subject:
Reply with quote

Hey bharath,

Thanks for your help. With little modification the code worked perfectly.

Thanks !!!
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am
No new posts How do I create a mainframe monitorin... anjali.bisht All Other Mainframe Topics 4 Fri Sep 01, 2017 2:20 pm

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