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

Inserting a special character $ into the records using SORT


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

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Apr 20, 2007 7:11 pm
Reply with quote

Here is my requirement, i have a file with 256 lrecl, and i need to insert a $ after 2,4,10,10.. so on.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Apr 20, 2007 7:33 pm
Reply with quote

krisprems,

Quote:
need to insert a $ after 2,4,10,10.. so on.


Its bit confusing. Provide more info what exactly you wanted.
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: Fri Apr 20, 2007 7:37 pm
Reply with quote

Hello,

Please show a few input records and what the output for those records needs to be. Yo don't need to show all 256 bytes, just the first 50 or so.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Apr 20, 2007 7:42 pm
Reply with quote

my i/p file looks like
Code:

12345678901234567890


Output should be
Code:

12$3456$7890123456$7890$
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 Apr 20, 2007 8:18 pm
Reply with quote

You can use a DFSORT job like this:

Code:

//S1    EXEC  PGM=ICEMAN                     
//SYSOUT    DD  SYSOUT=*                     
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file                       
//SYSIN    DD    *                           
   OPTION COPY
   INREC BUILD=(1,2,C'$',3,4,C'$',7,10,C'$',17,4,C'$',
     ...)
/*
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: Fri Apr 20, 2007 8:37 pm
Reply with quote

Hello,

Does your location use DFSORT or Syncsort or some other sort product?

How far "across" the record does the $ need to be inserted? Are all of the locatons that need to be shifted been shown? Will the overall length of a record increase to accomodate the inserted $s? Should the right-most bytes be truncated to keep the 256 length?

Your "output" doesn't match your requirement definition
Quote:
need to insert a $ after 2,4,10,10.. so on.
which is a bit confusing. . .
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Apr 20, 2007 9:03 pm
Reply with quote

Thanks Frank,
Me too solved myself and had resulted with the same code.
Thanks once again to all
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 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 Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top