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

Problem while putting condition in a VB file using SORT


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

New User


Joined: 10 Jun 2011
Posts: 13
Location: Kolkata

PostPosted: Mon Dec 05, 2011 6:59 pm
Reply with quote

Hi All,

I am trying to write a SORT where I need to select few records depending on record type and name from a VB file into a FB file

The record layout of my file is:
1 FILE1,
3 RECTYP CHAR (03),
3 FILLER1 CHAR (37),
3 NAME CHAR (04);

If I first convert the file to FB then try to inculde the condition it is wrorking fine

//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(5,3,CH,EQ,C'XYZ'),
OUTREC FILEDS=(5,1496,1500:X),CONVERT
//
and then use

//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(41,4,CH,EQ,C'ABCD')
//


But if I try to put the NAME condition while converting the VB to FB it is giving me error as

SORTOUT INCLUDE/OMIT FIELD BEYOND RECORD

//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(5,3,CH,EQ,C'XYZ',AND,45,4,CH,EQ,C'ABCD'),
OUTREC FILEDS=(5,1496,1500:X),CONVERT
//


Please suggest how can I solve this problem.


Thanks,
Nivi
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: Mon Dec 05, 2011 7:07 pm
Reply with quote

The INCLUDE is processed before the OUTREC.

You have records shorter than your key (presumably the second element).

Your OUTREC is extending all records to a fixed length, your INCLUDE seperately after that does not cause you a problem.

The curious thing is that it would imply you have short XYZ record(s), of which you are presumably unaware.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Dec 05, 2011 8:14 pm
Reply with quote

Please post the error message.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Mon Dec 05, 2011 9:19 pm
Reply with quote

Gylbharat posted:
Quote:
Please post the error message.


Nivi had previously posted:
Quote:
SORTOUT INCLUDE/OMIT FIELD BEYOND RECORD
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Dec 06, 2011 7:46 am
Reply with quote

Hi,

it would help if you cut and paste your job and use Code so it becomes readable.


This statement has a comma at the end which would give an error
Code:
INCLUDE COND=(5,3,CH,EQ,C'XYZ',AND,45,4,CH,EQ,C'ABCD'),


This statement also has an error in it, FILEDS should be FIELDS
Code:
OUTREC FILEDS=(5,1496,1500:X),CONVERT


Now, after you have corrected your typos, you can try running the job with this
Code:
//STEP0001 EXEC PGM=SORT,PARM='VLTESTI=1'     



Gerry
Back to top
View user's profile Send private message
nivedita.mukherjee16

New User


Joined: 10 Jun 2011
Posts: 13
Location: Kolkata

PostPosted: Tue Dec 06, 2011 10:38 am
Reply with quote

Hi,


Thanks a lot Gerry!!
It is working now.
It will really be helpful if you can explain what does this parm field do or
suggest any manual where I can get informations like this.


Thanks again
Nivi
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Dec 06, 2011 10:46 am
Reply with quote

Hi,

a search would have given plenty of hits

ibmmainframes.com/viewtopic.php?t=49970&highlight=vltesti

If you have SYNCSORT installed then you should obtain a copy of the manual.

Gerry
Back to top
View user's profile Send private message
nivedita.mukherjee16

New User


Joined: 10 Jun 2011
Posts: 13
Location: Kolkata

PostPosted: Tue Dec 06, 2011 11:12 am
Reply with quote

Thanks again Gerry!!!!!
I went through them

What I obtained is:

Quote:
When VLTESTI=1 is specified, a record that does not completely contain all INCLUDE/ OMIT fields is treated as having failed the comparison. SyncSort will omit the record if INCLUDE is being used or include the record if OMIT
has been specified.

When VLTESTI=2 is specified, SyncSort will treat comparisons to fields not completely contained within the record as false and decide a record's status for inclusion or omission from fields that are available. If all fields are not present, the record will be processed as having failed the comparison.

I am not very clear about this.
Can you please help me out to make it out.SyncSort will omit the record if INCLUDE is being used or include the recordif OMIT has been specified.
I also went through the link you specified

Thanks for helping!!!
Nivi
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: Tue Dec 06, 2011 11:33 am
Reply with quote

Hello,

Now that you have the info, suggest you run a few experiments and learn what really happens.

What you have posted looks rather clear. Where are you stuck?
Back to top
View user's profile Send private message
nivedita.mukherjee16

New User


Joined: 10 Jun 2011
Posts: 13
Location: Kolkata

PostPosted: Tue Dec 06, 2011 12:21 pm
Reply with quote

Hi,


I have got another query:
I am trying to create a trailer record using the following SORT CARD

Code:
  SORT FIELDS=COPY                                         
  TRAILER1=(1:'TRL',37X,41:COUNT=(TO=PD,LENGTH=11),225X)   



But it is giving me error as

Code:
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT 


Please help me to resolve this one


Thanks for helping!!! icon_smile.gif
Nivi
Back to top
View user's profile Send private message
nivedita.mukherjee16

New User


Joined: 10 Jun 2011
Posts: 13
Location: Kolkata

PostPosted: Tue Dec 06, 2011 12:38 pm
Reply with quote

sorry to all,

I got my fault

I have missed to mention the OUTFIL
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 Dec 07, 2011 10:32 am
Reply with quote

Good to hear you found it - thank you for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Mon Jan 02, 2012 5:10 pm
Reply with quote

This is my personal opinion, suggest we put information regarding VLTESTI = 1 & 2 in sticky part of this forum .... from the posts i read about syncsort involving VB files, Parm option VLTESTI seems to be the answer most of the times.

Moderators out there take your call.
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: Tue Jan 03, 2012 11:52 am
Reply with quote

Hello,

If you post what you would like to see as the content of this sticky, we would review this and split your contribution to a new Sticky.
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 split large record length file... DFSORT/ICETOOL 8
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top