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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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