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
 

 

Syncsort to extract the records
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort to extract the records
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    Post subject:
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

Senior Member


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

PostPosted: Tue Apr 19, 2011 4:14 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Apr 19, 2011 4:15 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Wed Apr 20, 2011 1:01 am    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Wed Apr 20, 2011 2:40 am    Post subject: Reply to: question about syncsort
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: 8593
Location: Back in jolly old England

PostPosted: Wed Apr 20, 2011 12:55 pm    Post subject:
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: 1714
Location: UK

PostPosted: Wed Apr 20, 2011 3:05 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Wed Apr 20, 2011 4:51 pm    Post subject: Reply to: question about syncsort
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Wed Apr 20, 2011 10:07 pm    Post subject: Reply to: question about syncsort
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    Post subject: Reply to: question about syncsort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu Apr 21, 2011 5:02 am    Post subject: Reply to: question about syncsort
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: 1703
Location: Australia

PostPosted: Thu Apr 21, 2011 7:33 am    Post subject:
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    Post subject: Reply to: question about syncsort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Fri Apr 22, 2011 4:08 am    Post subject: Reply to: question about syncsort
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 6 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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