IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to save the not included records in a file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shilpa.khaire

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Wed Jul 01, 2009 7:52 pm
Reply with quote

Hi!

I have an input file and based on some coniditons I am selecting records into one file OP1. Now I also want the leftover records in another file. I am trying to use the following, but gives me a syntax error WER268A. How can I get only the unslecetd records into a file?
Code:

OPTION COPY                                                       
OUTFIL FILES=OUT01,IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,           
             (264,2,CH,EQ,C'11',OR,264,2,CH,EQ,C'12')),           
             BUILD=(1,130,131:C'RMORTG',137,44)),                 
       IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,NE,C'11',OR,
             264,2,CH,NE,C'12')),                                 
            BUILD=(1,130,131:C'HELOAN',137,44)),                 
       IFTHEN=(WHEN=(21,3,CH,EQ,C'599',AND,24,9,ZD,EQ,0),         
            BUILD=(1,130,131:C'RMORTG',137,44)),                 
       IFTHEN=(WHEN=(21,3,CH,EQ,C'120',AND,(58,3,CH,EQ,C'142',OR,
             58,3,CH,EQ,C'152',OR,58,3,CH,EQ,C'181',OR,           
             58,3,CH,EQ,C'185',OR,58,3,CH,EQ,C'191',OR,           
             58,3,CH,EQ,C'194',OR,58,3,CH,EQ,C'195',OR,           
             58,3,CH,EQ,C'196')),                                 
            BUILD=(1,130,131:C'RMORTG',137,44)),                 
       IFTHEN=(WHEN=NONE,BUILD=(1,280))                           
       OUTFIL FILES=02,SAVE                                       

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 01, 2009 8:04 pm
Reply with quote

Perhaps if you showed the error messages, code, and output from the failure you would get help quicker.

Psychic day was cancelled this week.
Back to top
View user's profile Send private message
shilpa.khaire

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Wed Jul 01, 2009 8:42 pm
Reply with quote

I'll repost the code which did not abend. But the LEFTOVER fiel has all the records...while i was expecting only the records not selected in it. So I tried changing the code to teh one I showed above and now I get a syntax error - WER268A OUTFIL STATEMENT : SYNTAX ERROR. Here is the code which did not abend. My main objective here is to get the leftover records (not all of them) in the LEFTOVER file.
Code:

//PS0100  EXEC PGM=CHECKCC,PARM='PGMN=SORT,ABEND=0001'     
//*                                                       
//SORTIN   DD DISP=SHR,DSN=input file   
//*                                                       
//SORTOUT  DD DSN=selected records file,         
//            DISP=(,CATLG,DELETE),UNIT=(,30),             
//            SPACE=(CYL,(1000,50),RLSE)                   
//SYSOUT   DD SYSOUT=*                                     
//SYSPRINT DD SYSOUT=*                                     
//SYSUDUMP DD SYSOUT=*                                     
//SYSABEND DD SYSOUT=*                                     
//LEFTOVER DD DSN=unselected records,               
//            DISP=(,CATLG,DELETE),UNIT=(,30),             
//            SPACE=(CYL,(1000,50),RLSE)                   
//SYSIN    DD *                                           
 OPTION COPY                                               
 OUTREC IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,EQ,C'11',OR, 
              264,2,CH,EQ,C'12')),                                 
              BUILD=(1,130,131:C'RMORTG',137,44)),                 
        IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,NE,C'11',OR, 
              264,2,CH,NE,C'12')),                                 
             BUILD=(1,130,131:C'HELOAN',137,44)),                   
        IFTHEN=(WHEN=(21,3,CH,EQ,C'599',AND,24,9,ZD,EQ,0),         
             BUILD=(1,130,131:C'RMORTG',137,44)),                   
        IFTHEN=(WHEN=(21,3,CH,EQ,C'120',AND,(58,3,CH,EQ,C'142',OR, 
              58,3,CH,EQ,C'152',OR,58,3,CH,EQ,C'181',OR,           
              58,3,CH,EQ,C'185',OR,58,3,CH,EQ,C'191',OR,           
              58,3,CH,EQ,C'194',OR,58,3,CH,EQ,C'195',OR,           
              58,3,CH,EQ,C'196')),                                 
             BUILD=(1,130,131:C'RMORTG',137,44)),                   
        IFTHEN=(WHEN=NONE,BUILD=(1,280))                           
        OUTFIL FNAMES=LEFTOVER,SAVE                                 
*       IFTHEN=(WHEN=NONE,BUILD=(1:1,280))                         
/*                                                                 



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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jul 01, 2009 9:13 pm
Reply with quote

Hello,

Is there some reason you do not post the informational output from Syncsort (including the message ids)?

You may wat to use 2 OUTFIL statements and specify which records should be placed in each.
Back to top
View user's profile Send private message
shilpa.khaire

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Wed Jul 01, 2009 9:19 pm
Reply with quote

dick scherrer wrote:
Hello,

Is there some reason you do not post the informational output from Syncsort (including the message ids)?

You may wat to use 2 OUTFIL statements and specify which records should be placed in each.


I tried using OUTFIL as I mentioned in my first post, but then I am getting an error which is mentioned below.
Here goes the entire synsort informational op.
SYSIN :
OPTION COPY
OUTFIL FILES=OUT01,IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,
*
(264,2,CH,EQ,C'11',OR,264,2,CH,EQ,C'12')), .....................
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
If there is any oother way to get the unslected records please let me know.
Thanks!
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jul 01, 2009 9:36 pm
Reply with quote

shilpa.khaire,

Quote:
OUTFIL FILES=OUT01,IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,
*
(264,2,CH,EQ,C'11',OR,264,2,CH,EQ,C'12')),
You have 3 open braces and you have closed only two and hence the syntax error.

1) But I think you dont need this many IFTHENs here. You have coded the same BUILD statement
Code:
BUILD=(1,130,131:C'RMORTG',137,44)),
for 3 IFTHEN statements, why not combine all the conditions into a single IFTHEN?

2) And consider the below part
Code:
        IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,EQ,C'11',OR, 
              264,2,CH,EQ,C'12')),                                 
              BUILD=(1,130,131:C'RMORTG',137,44)),                 
        IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,NE,C'11',OR, 
              264,2,CH,NE,C'12')),                                 
             BUILD=(1,130,131:C'HELOAN',137,44)),                   
suppose when you have 264,2,CH is equal to '11', wont both the above IFTHENs become true? Should n't the 2nd IFTHEN condition be separated by an 'AND' instead of 'OR'? In which case do you want 'RMORTG' and in which case you want 'HELOAN'. Concentrate on your requirement and explain it clearly before trying to correct the syntax error.
Back to top
View user's profile Send private message
shilpa.khaire

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Wed Jul 01, 2009 9:49 pm
Reply with quote

arcvns wrote:
shilpa.khaire,

Quote:
OUTFIL FILES=OUT01,IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,
*
(264,2,CH,EQ,C'11',OR,264,2,CH,EQ,C'12')),
You have 3 open braces and you have closed only two and hence the syntax error.

1) But I think you dont need this many IFTHENs here. You have coded the same BUILD statement
Code:
BUILD=(1,130,131:C'RMORTG',137,44)),
for 3 IFTHEN statements, why not combine all the conditions into a single IFTHEN?

2) And consider the below part
Code:
        IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,EQ,C'11',OR, 
              264,2,CH,EQ,C'12')),                                 
              BUILD=(1,130,131:C'RMORTG',137,44)),                 
        IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,NE,C'11',OR, 
              264,2,CH,NE,C'12')),                                 
             BUILD=(1,130,131:C'HELOAN',137,44)),                   
suppose when you have 264,2,CH is equal to '11', wont both the above IFTHENs become true? Should n't the 2nd IFTHEN condition be separated by an 'AND' instead of 'OR'? In which case do you want 'RMORTG' and in which case you want 'HELOAN'. Concentrate on your requirement and explain it clearly before trying to correct the syntax error.


Yes, I agree with you on the third observation. I shoould have an AND insetad of an OR. For the no of braces, I do have a closing brace after BUILD. I tried the following but still gives me syntax error.

Code:

OPTION COPY                                                     
       OUTFIL FILES=OUT01,IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND, 
              *                                                 
             (264,2,CH,EQ,C'11',OR,264,2,CH,EQ,C'12'))),       
             BUILD=(1,130,131:C'RMORTG',137,44),               

Can you help me with having all 3 BUILD in one statement? Will the LEFTOVER file have only unslecetd records?

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

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Thu Jul 02, 2009 12:03 am
Reply with quote

Hi arcvns ,

I am waitng for ur reply. In the meanwhile I tried many options, but i am not able to get the unslecetd records in another file. Please help!

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 02, 2009 12:30 am
Reply with quote

Hello,

Quote:
I am waitng for ur reply.
Until you post complete info it will be most difficult for anyone to help. . .

Your last post shows an * under FILES, but that code does not match the jcl you posted. You also did not post the diagnostic info.

So, post the current jcl and sort control info, and all of the diagnostic info, not just some bit you choose. . . There is no reason for people here to try to figure out what happened as it is already available if you simply post it. . .
Back to top
View user's profile Send private message
shilpa.khaire

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Thu Jul 02, 2009 12:36 am
Reply with quote

Code:

       Field1             Field2      Field3     FIeld4     
       3/AN          9/SNUM       3/AN       17/AN       
       (21-23)       (24-32)       (58-60)    (264-280)   
       3------------ 4--------- 10-------- 47----------
000001 393               151150 140        11
000002 393               151210 140        12         
000003 393               151210 140        13         
000004 393               151150 140        11         
000005 393               151150 140                   
000006 393               151150 140        12         
000007 393               151150 140                   
000008 599                    0 140                   
000009 599               151150 140                   
000010 393                    0 140                   
000011 120               151150 142                   
000012 120               151210 181                   
000013 120               151150 185                   
000014 120               151150 191                   
000015 120               151150 194                   
000016 120               151210 195                   
000017 120               151210 196                   


Other than the 9'th record all records should be included.
I hope this helps in understanding my reqmt.

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 02, 2009 2:47 am
Reply with quote

Hello,

Is there some reason you again did not post the code? By now, it is unlikely that the code you are using is the same as you posted before. . .

Which output is this or is this the input?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jul 02, 2009 9:01 am
Reply with quote

shilpa.khaire,

Quote:
Other than the 9'th record all records should be included.
That does n't seem like the rule you are using inside your control cards. Post both the input and expected output and mention all the rules for routing an input record to a particular output file. Nobody here knows about your requirement. Please put a little bit effort in explaining it.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 2
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top