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

Variable Records Length SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
praveenbl22
Currently Banned

New User


Joined: 26 Sep 2007
Posts: 24
Location: Bangalore

PostPosted: Thu Dec 27, 2007 10:56 am
Reply with quote

Hi,
I have input file of variable record length and i have to extract 2 bytes record from the file.
My sort card looks something like this



Code:

SORT FIELDS=COPY                       
INCLUDE COND=(27,1,CH,EQ,C'1',OR,       
           148,2,CH,NE,C'  ')           
OUTREC FIELDS=(2:148,2)         


The Following error message displayed in the spool.


Code:

ICE201I E RECORD TYPE IS V - DATA STARTS IN POSITION 5                         
ICE150I 0 VLSHRT NOT USED FOR SORT, MERGE, INCLUDE, OMIT OR SUM STATEMENT FIELDS
ICE126A 0 INCONSISTENT *OUTREC  IFTHEN 0 REFORMATTING FIELD FOUND               
ICE751I 0 C5-K24705 C6-K90007 C7-K90000 C8-K90007 E9-K90007 E7-K24705           


The Output should should not contain duplicates.

I tried using the OPTION VLSHRT in the Sort Card but still the message exits.The 2 Byte field starts at the position 148 which is not unique.
The File contains two records types '1' and '2' respectively. The record type '1' is only included.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Dec 27, 2007 12:43 pm
Reply with quote

Praveen,

Is your output a VB file?
Back to top
View user's profile Send private message
praveenbl22
Currently Banned

New User


Joined: 26 Sep 2007
Posts: 24
Location: Bangalore

PostPosted: Thu Dec 27, 2007 12:48 pm
Reply with quote

NO,Output file is sequentail file with record length 3.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Dec 27, 2007 12:57 pm
Reply with quote

Quote:

SORT FIELDS=COPY
INCLUDE COND=(27,1,CH,EQ,C'1',OR,
148,2,CH,NE,C' ')
OUTREC FIELDS=(2:148,2)


You need to consider the RDW in a VB file, so if you are pointing at 1st column you need to code as 1+4=5th column where 4 bytes is for the RDW.

You can change your DFSORT statements like this with VLSHRT option
Code:

  OPTION VLSHRT,COPY
  INCLUDE COND=(31,1,CH,EQ,C'1',OR,       
           152,2,CH,NE,C'  ')           
  OUTFIL BUILD=(2:152,2),VTOF 


Click here to know VB Data Set Considerations
Back to top
View user's profile Send private message
praveenbl22
Currently Banned

New User


Joined: 26 Sep 2007
Posts: 24
Location: Bangalore

PostPosted: Thu Dec 27, 2007 2:32 pm
Reply with quote

How do i eliminate the duplicates?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Dec 27, 2007 3:42 pm
Reply with quote

praveenbl22 wrote:
How do i eliminate the duplicates?
Eliminate duplicates based on what key?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Dec 27, 2007 10:32 pm
Reply with quote

Quote:
How do i eliminate the duplicates?


In order to eliminate duplicates, you must remove the COPY operand and specify a SORT statement with a key or keys on which the records will be matched, and a SUM FIELDS=NONE statement. Remember to add 4 to the starting position for each sort key. For example, if you want to eliminate duplicates on positions 152-153, you could use:

Code:

  OPTION VLSHRT
  INCLUDE COND=(31,1,CH,EQ,C'1',OR,       
           152,2,CH,NE,C'  ')           
  SORT FIELDS=(152,2,CH,A)
  SUM FIELDS=NONE
  OUTFIL BUILD=(2:152,2),VTOF   



If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Thu Dec 27, 2007 10:42 pm
Reply with quote

If the record type is in col 27+4=31 and he wants record type 1 only then
shouldn't INCLUDE COND=(31,1,CH,EQ,C'1',OR,152,2,CH,NE,C' ') be changed to INCLUDE COND=(31,1,CH,EQ,C'1',AND,152,2,CH,NE,C' ')
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Dec 27, 2007 11:01 pm
Reply with quote

As written with OR, the INCLUDE statement would include records with '1' in 31 or with nonblank in 152-153. If the OR wants to include records with '1' in 31 and with nonblank in 152-153, then AND would be correct. You may be right that AND is needed, but only the OP knows for sure what he wants.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 Store the data for fixed length COBOL Programming 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top