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

Syncsort to extract the records


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

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Apr 19, 2011 4:06 pm
Reply with quote

Hi,

I have to extract the records with the below criteria.
1. The record should not have 'SUP' from the position 7(File is a VB file).
2. It should not contain the word <FSA> in the entire record.

My VB files LRECL is 32000.. Here is what i have tried....

Code:

OPTION COPY                             
OMIT COND=((4,32000,SS,EQ,C'<FSA>'),OR,
           (11,3,CH,NE,C'SUP'))       


But this is not working please help.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Apr 19, 2011 4:09 pm
Reply with quote

Sorry this is what i tried.
Code:
OPTION COPY                                 
OMIT COND=((4,32000,SS,EQ,C'<FSA>'),AND,   
           (11,3,CH,NE,C'SUP'))             
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Apr 19, 2011 4:14 pm
Reply with quote

If the condition 1 AND 2 are not mutally exclusive for your case -- you've to use "AND" instead of OR in your Sort-card.

If that's not the case, please tell us -- how it is not working? What do you get in the output, which makes you say, it's not working.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Apr 19, 2011 4:15 pm
Reply with quote

Well, did not see your reply until I hit "Submit" on my terminal. So, first observation in my previous post does not stand -- what do you get in output, which makes you say, it's not working.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Apr 19, 2011 4:47 pm
Reply with quote

Thanks for the response anuj.
This is the input i am using.....

Code:
 
 dd   SUP 1  2511      0 NNNN <FSA>       
  '5  BAS 2 32011      0 NNNN <FSA>       
 8N   BDE 3 23411      0 NNNN 000000110415
      SUP 3 23211      0 NNNN 000000110415
      BAS    3811      0 NYYN 000000110415


I'm getting the output file as ,

Code:

 dd   SUP 1  2511      0 NNNN <FSA>       
  '5  BAS 2 32011      0 NNNN <FSA>       
 8N   BDE 3 23411      0 NNNN 000000110415
      SUP 3 23211      0 NNNN 000000110415
      BAS    3811      0 NYYN 000000110415   


what I'm trying to do is,
Exclude records which has '<FSA>' and value in position 11:3 not equal to 'SUP'.

(i.e.) Only the second record in the Input file should be excluded(it has <FSA> and 11:3 not equal to 'SUP'.

Please help.

If what i wrote is not clear, please let me know i will explain it again.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Apr 20, 2011 1:01 am
Reply with quote

It looks you have got that all correct; however,

  • You have used "SS" and using 32,000 VB LRECL -- how about using VLSHRT? I assume, not all the records are of lenght 32,000.
  • If you are thinking about RDW then sort statemetns should be like =(5,....
    RDW is of four bytes.

  • And are you sure, have you used the correct positions? As the sort statements does not have any syntax-error, however, there might be a logical error.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 20, 2011 2:40 am
Reply with quote

11 doesn't look right as a start position for SUP, but that might just be the way it is displayed here. Check anyway.

As Anuj says, the Record Descriptor Word is, well, it's a word long (four bytes). So your first parameter should start with 5, not 4, although it should have no affect on the processing. So, the position of SUP looks wrong, and a valid-looking statement isn't working. Check. 4 for RDW, then however many until your field starts - it looks less than 11, anyway.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Apr 20, 2011 12:55 pm
Reply with quote

Bill, 11 would be correct fo a VB input file as the sort products include the RDW whereas most other programs do not.

I checked the OP's positioning and the SUP is in pos 7 which is really pos 11 including the RDW.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Apr 20, 2011 3:05 pm
Reply with quote

Depends whether he is showing the RDW in the data shot. But it could be all application data.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 20, 2011 4:51 pm
Reply with quote

It looks all messy when I look inside the "code" block. For some reason HEX and SCALE don't work on my browser.

I think the squirly bits of display are data, as otherwise the record-length has run into the IOCS, which it won't.

How about, I don't like suggesting, splitting in two just to find out which is working.

Also, check your JCL. I have known people to have DISP=(NEW,CATLG) and leaving uncatalogued datasets lying around with the latest data in, but they continually look at the catalogued one and can't understand why no changes take place. DISP=MOD might play similar tricks (I don't know specifically from a modern SORT).
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Wed Apr 20, 2011 7:21 pm
Reply with quote

I can assure you guys that SUP is in position 11 only. but still its not working.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Apr 20, 2011 7:26 pm
Reply with quote

shankarm wrote:
I can assure you guys that SUP is in position 11 only. but still its not working.

Is the file VB or VBA?
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Wed Apr 20, 2011 7:30 pm
Reply with quote

its a VB file.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Apr 20, 2011 7:36 pm
Reply with quote

Anuj wrote:
how about using VLSHRT? I assume, not all the records are of lenght 32,000.

Anuj, shouldn't it be VLSCMP rather than VLSHRT?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 20, 2011 10:07 pm
Reply with quote

Hi Shan,

Any thoughts on my suggestion to submit the two parts of your condition seperately to find out if they are working? They will either both work individiually, or one will work, or the other will work, or neither will work. Whatever happens, we will have more information to work on.
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Thu Apr 21, 2011 4:45 am
Reply with quote

Hi Shankar,

Hope this works.....
Please try and let us know.....

Code:
//STEP1   EXEC PGM=SORT,PARM='VLTESTI=2'                       
//SYSPRINT DD SYSOUT=*                                         
//SORTIN   DD DSN=VBFILE.IN,DISP=SHR                           
//SORTOUT  DD DSN=VBFILE.OUT,DISP=SHR                           
//SYSOUT   DD SYSOUT=*                                         
//SYSIN    DD *                                                 
    SORT FIELDS=COPY                                           
   OMIT COND=((15,3,CH,EQ,C'SUP'),AND,(1,32000,SS,EQ,C'<FSA>'))


Thanks,
Sab
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 21, 2011 5:02 am
Reply with quote

Sab,

You've swapped the statements around. Are you suggesting that will fix the problem?

Why did you change the start positions? Starting at 1 will be looking at the entire record, including the RDW, so should be 5. And 15 will miss the value SUP for definite.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Apr 21, 2011 7:33 am
Reply with quote

Hi,

can you show the records with HEX ON and COLS.

Also the SYSOUT messages produced from job.


Gerry
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Fri Apr 22, 2011 3:39 am
Reply with quote

Hi Bill,
But It fixed the problem.

Input:
Code:
 dd       SUP 1  2511      0 NNNN <FSA>         
  '5      BAS 2 32011      0 NNNN <FSA>         
 8N       BDE 3 23411      0 NNNN 000000110415 
          SUP 3 23211      0 NNNN 000000110415 
          BAS    3811      0 NYYN 000000110415


Output i got


Code:
  '5      BAS 2 32011      0 NNNN <FSA>         
 8N       BDE 3 23411      0 NNNN 000000110415   
          SUP 3 23211      0 NNNN 000000110415   
          BAS    3811      0 NYYN 000000110415   


Sysout:
Code:
 SYSIN :                                                               
     SORT FIELDS=COPY                                                 
    OMIT COND=((15,3,CH,EQ,C'SUP'),AND,(1,32000,SS,EQ,C'<FSA>'))       
 WER108I  SORTIN   : RECFM=VB   ; LRECL= 32000; BLKSIZE= 32004         
 WER110I  SORTOUT  : RECFM=VB   ; LRECL= 32000; BLKSIZE= 32004         
 WER055I  INSERT          0, DELETE          1                         
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                         
 WER054I  RCD IN          5, OUT          4                           
 WER169I  RELEASE 1.3 BATCH 0488 TPF LEVEL 1.0                         
 WER052I  END SYNCSORT - COGBEFLA,STEP1,,DIAG=AC00,73C0,8026,00CC,E4DA,
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 22, 2011 4:08 am
Reply with quote

Hi Sab,

I was asking if you had swapped the conditions around because you were aware of a particular problem with coding them the other way.

Although your input file looks different, your parameters should help the TS to get somewhere as, as you say, one record has been deleted (I assume you have checked that it is the correct one).

The (1,32000... will start the search in the Record-length/IOCS (Record Descriptor Word/RDW) where you will not find C'<FSA>'. Later, someone looking at the code will wonder why you did that. It should be (5,32000... so that is starts instead in the data.

So, Shan, back to you if you haven't already fixed it. I'm thinking JCL...
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Fri Apr 22, 2011 4:19 am
Reply with quote

Bill,

Quote:
Although your input file looks different, your parameters should help the TS to get somewhere as, as you say, one record has been deleted (I assume you have checked that it is the correct one).


I didnt use a different input file.. i'm using the same file(VB 32000) as input with 'SUB' in position 11.
I think the parameter 'SUB' is in 11th position. It has been confirmed by Shan in previous conversations.....

Thanks,
Sab.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 22, 2011 4:43 am
Reply with quote

sabarikanth wrote:
Bill,

Quote:
Although your input file looks different, your parameters should help the TS to get somewhere as, as you say, one record has been deleted (I assume you have checked that it is the correct one).


I didnt use a different input file.. i'm using the same file(VB 32000) as input with 'SUB' in position 11.
I think the parameter 'SUB' is in 11th position. It has been confirmed by Shan in previous conversations.....

Thanks,
Sab.


Hi Sab,

Well, your file looks different. Look at your display in your post and look at the original. Different?

With a VB file, you have the RDW. SORT still wants you to take the RDW into account when specifying your parameters. 11 from the original example includes the 4 for the RDW, so in the data SUP starts at position 7. In your file, you start at 11 in the data, which requires 15 in the sort parameter.

Any answer at all on why you swapped the conditions around? Last time that I ask.
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 Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top