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
 
How to write special character using PARSE in SORT.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vaibhavjadhav

New User


Joined: 27 Jul 2007
Posts: 33
Location: mumbai

PostPosted: Wed Mar 16, 2011 10:57 pm    Post subject: How to write special character using PARSE in SORT.
Reply with quote

Hi,

Could you please help me in writing the below output using PARSE in SORT or ICETOOL.

Explanation:
The input is a comma delimited and want the output to be written as replacing comma with * as shown below. Also the field STATUS and its value in all the records and header should be written as $.

Code:

Input:

POLNO,AGENTNO,STATUS,FREQ,GENDER
00001,001,SP,MONTHLY,MALE
002,02,AP,YEARLY,FEMALE
03,003,AP,HALF,MALE
0004,04,SP,QUARTELY,MALE
00005,005,AP,MONTHLY,FEMALE


Output:

POLNO*AGENTNO*$*FREQ*GENDER
00001*001*$*MONTHLY*MALE
002*02*$*YEARLY*FEMALE
03*003*$*HALF*MALE
0004*04*$*QUARTELY*MALE
00005*005*$*MONTHLY*FEMALE
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: Wed Mar 16, 2011 11:18 pm    Post subject:
Reply with quote

You can use DFSORT statements like the following to do what you asked for:

Code:

  OPTION COPY                                             
  INREC IFTHEN=(WHEN=INIT,FINDREP=(IN=C',',OUT=C'*')),     
    IFTHEN=(WHEN=INIT,                                     
      PARSE=(%01=(ENDAT=C'*',FIXLEN=10),                   
             %02=(ENDAT=C'*',FIXLEN=10),                   
             %=(ENDBEFR=C'*'),                             
             %03=(FIXLEN=20)),                             
      BUILD=(%01,%02,C'$*',%03)),                         
   IFTHEN=(WHEN=INIT,OVERLAY=(1:1,42,SQZ=(SHIFT=LEFT)))   
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 Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am

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