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

Exclude Header and Trailer from Outrec


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

New User


Joined: 06 Feb 2007
Posts: 29
Location: Noida

PostPosted: Tue Mar 12, 2013 12:46 am
Reply with quote

Hi,

I have a file of 49 bytes, it has a header, detail record and trailer. I want to put in 00 in the 20th bytes and copy rest of the data to a new file, I also want to keep the header and trailer as it is.
Code:

----+----1----+----2----+----3----+----4----+----
********************************* Top of Data ***
0SL122012
1211740  20425173021108857923091822794830450372
900001


My file should look like
Code:

----+----1----+----2----+----3----+----4----+----
********************************* Top of Data ***
0SL122012
1211740  2042517302001108857923091822794830450372
900001


I have tried using DATASORT but that does not allow OUTFIL OUTREC or BUILD. I have the TOOLIN data as

Code:


//TOOLIN DD *
MODE STOP
DATASORT FROM(I1) TO(O1) HEADER(1) TRAILER(1) USING(CTL1)
//CTL1CNTL DD *
   OUTFIL BUILD=(1:1,19,20:C'00',22:20,28)


But it gives me an error
Code:

DATASORT FROM(I1) TO(O1) HEADER(1) TRAILER(1) USING(CTL1)
SORT FUNCTION IS REQUIRED FOR DATASORT OPERATION
OPERATION RETURN CODE:  12


Please let me know how to resolve it.

Thanks
Sudib19
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: Tue Mar 12, 2013 12:53 am
Reply with quote

Do you want the data sorted?

Code:
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),
                  OVERLAY=(20:C'00'))
Back to top
View user's profile Send private message
sudib19

New User


Joined: 06 Feb 2007
Posts: 29
Location: Noida

PostPosted: Tue Mar 12, 2013 1:27 am
Reply with quote

Thanks for your post Bill

No I do not need the data to be sorted.

The data in position 20 can be anything.

I would need 00 to be added to the 20th position.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Mar 12, 2013 1:31 am
Reply with quote

sudib19 wrote:
Thanks for your post Bill

No I do not need the data to be sorted.

The data in position 20 can be anything.

I would need 00 to be added to the 20th position.


sudib19,

why are using DATASORT when you don't need the data to be sorted? It is a simple COPY step. Use the control cards shown by Bill but use a COPY operator.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Mar 12, 2013 1:32 am
Reply with quote

sudib19 wrote:
Thanks for your post Bill

No I do not need the data to be sorted.

The data in position 20 can be anything.

I would need 00 to be added to the 20th position.
That is to say, you wish the characters "00" inserted at the 20th position, with the data in positions 21-47 shifted to the right. The input data set is generated by a program written by someone who knew what was doing, so positions 47-49 are guaranteed to be spaces, hex zeroes, or other "don't care" values, right?
Back to top
View user's profile Send private message
sudib19

New User


Joined: 06 Feb 2007
Posts: 29
Location: Noida

PostPosted: Tue Mar 12, 2013 2:28 am
Reply with quote

Thanks all for your help.
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: Tue Mar 12, 2013 6:27 am
Reply with quote

DATASORT is for sorting the data whilst leaving any headers or trailer which you identify to it in their original relative positions on the file.

DATASORT requires a SORT statement, which will be applied to all records not identified as headers or trailers.

It is not just a way to exclude headers and trailers from your processing.

Due to the 0, 1 or 9 in the first position of each record, it is easy for you to identify the data records, and to only change those, with the simple IFTHEN=(WHEN=(logicalexpresion shown to you with the OVERLAY to change the data positions to the value you require.
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 Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Adding a trailer with record count an... JCL & VSAM 4
Search our Forums:

Back to Top