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

How to select a column range for output using SORT utility


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

New User


Joined: 19 May 2007
Posts: 5
Location: Toronto, Ontario

PostPosted: Wed Jun 06, 2007 1:59 am
Reply with quote

I wanted to select and sort 28 characters from the input dataset. I defined the output dataset to be fixed length 28. My SORT control statements are simply:

SORT FIELDS=(4,28,CH,A)
OUTREC FIELDS=(4,28)

I get:
INVALID DATA SET ATTRIBUTES SPECIFIED SORTOUT RECFM
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 Jun 06, 2007 3:48 am
Reply with quote

Hello,

Please post your complete jcl and control statements as well as the diagnostic information you received when you ran the job.
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: Wed Jun 06, 2007 4:00 am
Reply with quote

Jason,

You can look up that ICE043A message here:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CM20/2.2?DT=20060721170811

Your control statements are ok, but in order to get that error message, you must have some kind of mismatch between the RECFMs of the input and output data sets. For example, the SORTIN file has RECFM=VB but you specified RECFM=FB for SORTOUT. As William says, show us your JCL, control statements and //SYSOUT messages (with the ICExxxs prefixes) and explain what you're trying to do (e.g. I'm trying to convert from VB to FB) and we'll tell you how to do it.
Back to top
View user's profile Send private message
Jason Philip

New User


Joined: 19 May 2007
Posts: 5
Location: Toronto, Ontario

PostPosted: Wed Jun 06, 2007 7:03 pm
Reply with quote

The input is VB 804. I want chars 4-31 in the output. I added 4 to account for the need to account for the bytes at the front of the record. I get a user completion code of 0043. Reason = 00000000 861. Not sure if the 861 is related.

JCL:
//TCCVJPS JOB (VD,898910),'P4,PHILIP',CLASS=A,NOTIFY=*,
// MSGCLASS=Q,TIME=10
//*
//SORT EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=TCCV.GB02.COPYLOG(0)
//SORTOUT DD DISP=SHR,DSN=TCCV.TCCVJP.CPYLOG80
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(8,28,CH,A)
OUTREC FIELDS=(8,28)
/*
SYSOUT:
ICE000I J - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 09:30 ON WED JUN
SORT FIELDS=(8,28,CH,A)
OUTREC FIELDS=(8,28)
ICE043A K INVALID DATA SET ATTRIBUTES SPECIFIED SORTOUT RECFM
ICE052I J END OF DFSORT
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: Wed Jun 06, 2007 8:58 pm
Reply with quote

The U0043 abend is associated with the ICE043A message. The ICE043A message indicates a RECFM conflict between you SORTIN and SORTOUT data sets. If your SORTIN data set has RECFM=VB as you say, then the conflict would be caused by your SORTOUT data set having RECFM=FB.

If you want to convert from a VB file to an FB file, you need to use the following control statements:

Code:

    SORT FIELDS=(8,28,CH,A)
    OUTFIL VTOF,BUILD=(8,28)
Back to top
View user's profile Send private message
Jason Philip

New User


Joined: 19 May 2007
Posts: 5
Location: Toronto, Ontario

PostPosted: Thu Jun 07, 2007 7:39 pm
Reply with quote

Thanks Frank. I added the VTOF parameter exactly as you specified but got the error:

Code:

ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5
           SORT FIELDS=(8,28,CH,A)
           OUTFIL VTOF, BUILD=(8,28)
ICE003A 0 CONTINUATION LINE MISSING


So, figuring I could get around the VTOF problem by specifying a VB28 output file, I ran with the original JCL, and got this error:

Code:

ICE000I J - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 -
           SORT FIELDS=(8,28,CH,A)
           OUTREC FIELDS=(8,28)
ICE201I J RECORD TYPE IS V - DATA STARTS IN POSITION 5
ICE126A J INCONSISTENT *OUTREC  IFTHEN 0 REFORMATTING FIELD FOUND
ICE052I J END OF DFSORT
Back to top
View user's profile Send private message
Jason Philip

New User


Joined: 19 May 2007
Posts: 5
Location: Toronto, Ontario

PostPosted: Fri Jun 08, 2007 12:18 am
Reply with quote

Hi Frank,

Thanks for all the help. I'm finding out a lot about this powerful utility. Apparently I needed to add "1:" in the OUTFIL OUTREC statement to specify where in the output file the data was to start. That worked.

Thanks again,

Jason
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: Sat Jun 09, 2007 8:15 pm
Reply with quote

Quote:
I added the VTOF parameter exactly as you specified


Well, no you didn't. I have:

Code:

   OUTFIL VTOF,BUILD=(8,28)


But you have:

Code:

  OUTFIL VTOF, BUILD=(8,28)


You have a space before BUILD whereas I don't and that makes all the difference. The space indicates the end of the parameters so you essentially have:

Code:

  OUTFIL VTOF, 


The comma indicates the next line should have another parameter, but you don't have one so you get the continuation error.

Just remove the space before BUILD and it will work.

Quote:
Apparently I needed to add "1:" in the OUTFIL OUTREC statement to specify where in the output file the data was to start. That worked.


That wouldn't have worked. You must have done something else. The problem is that for a VB input file (when you don't specify VTOF), you must specify the RDW in positions 1,4. So you would need:

Code:

   OUTREC FIELDS=(1,4,8,28)
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
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
No new posts To get the count of rows for every 1 ... DB2 3
Search our Forums:

Back to Top