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

Variable length records and VLSCMP option


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

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Fri Oct 06, 2006 12:15 am
Reply with quote

Hi ya'll...
I have two questions...Firstly...
Here is my challenge . I'm sorting variable length records...I'm allowing for the 4 byte RDW the field I'm sorting on is in 516 so I put 520


I'm using this as the sort parameter
//SYSIN DD *
SORT FIELDS=(520,4,CH,A)

however some records are shorter that 520 bytes so I get this error

ICE218A 0 101 BYTE VARIABLE RECORD IS SHORTER THAN 523 BYTE MINIMUM FOR FIELDS
ICE751I 1 D8-Q83041 D4-Q84357 E8-Q95214
ICE052I 0 END OF DFSORT

I looked up the error and it stated this...
Quote:
If a variable-length record was too short to contain all INCLUDE or OMIT fields, use the VLSCMP or VLSHRT option to prevent DFSORT from terminating.


Can anyone give me an example syntax on how to use VLSCMP or VLSHRT so I can avoid the problem.

Secondly...

Then I have to SUM on that 4 byte character field...
is this possible to sum on a non numeric field


Thanx in advance
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: Fri Oct 06, 2006 12:50 am
Reply with quote

If you look up the ICE218A message, you'll see this in the Programmer Response:

If the variable-length record was too short to contain all SORT, MERGE or SUM fields, use the VLSHRT option to prevent DFSORT from terminating.

Here's a link to the message doc:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CM20/2.2.207?SHELF=&DT=20060721170811&CASE=

That's telling you that for short SORT fields, you can use DFSORT's VLSHRT option, e.g.

Code:

   OPTION VLSHRT


(VLSCMP is only for short INCLUDE/OMIT fields.)

Quote:
is this possible to sum on a non numeric field


It depends on what the "non-numeric field" values look like. If they're actually numbers, e.g. '1234', you can use ZD to SUM on them. If they're something else, you need to show what they look like and explain what you want for the result of "summing" them.
Back to top
View user's profile Send private message
srj1957

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Fri Oct 06, 2006 1:21 am
Reply with quote

Thanks again Frank...

I tried the
//SYSIN DD *
SORT FIELDS=(520,4,CH,A)
OPTION VLSHRT

and it worked without any INCLUDE/OMIT !??!

My SUM challenge is with letters not numbers

ATTZ
ATTZ
CCSW
COUZ
COUZ
COUZ
CCSW
ABCZ
COUZ
ABCZ
COUZ

I want my output to be
ABCZ
ATTZ
CCSW
COUZ

Thanks in advance..
Steve
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: Fri Oct 06, 2006 1:42 am
Reply with quote

VLSHRT can be used with SORT, MERGE, INCLUDE, OMIT and/or SUM.

Quote:
My SUM challenge is with letters not numbers


Oh, then you really don't want to SUM anything - you just want to eliminate duplicates. That would be:

Code:

   SUM FIELDS=NONE


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
srj1957

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Fri Oct 06, 2006 1:49 am
Reply with quote

Quote:
SUM FIELDS=NONE


of course icon_redface.gif ...I totally forgot about that option....

thanks anyway Frank...
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 Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top