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
 

 

Variable Records Length SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Variable Records Length SORT
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: 1288
Location: Chennai, India

PostPosted: Thu Dec 27, 2007 12:43 pm    Post subject: Reply to: Variable Records Length SORT
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Dec 27, 2007 10:32 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject:
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 Moderator


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

PostPosted: Thu Dec 27, 2007 11:01 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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