Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us