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
 

 

Inserting a special character $ into the records using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Inserting a special character $ into the records using SORT
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: 1439
Location: Bangalore,India

PostPosted: Fri Apr 20, 2007 7:33 pm    Post subject:
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 20, 2007 7:37 pm    Post subject:
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    Post subject: insert $
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 Moderator


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

PostPosted: Fri Apr 20, 2007 8:18 pm    Post subject:
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 20, 2007 8:37 pm    Post subject:
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    Post subject: thanx
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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