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
 
Using Replace option

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

New User


Joined: 14 Jul 2010
Posts: 13
Location: United States

PostPosted: Wed Jul 14, 2010 8:36 pm    Post subject: Using Replace option
Reply with quote

I have an Input file with group names. Some group names might have corresponding asociation name. Following is a sample

City of Joy - > Group name without an association.
AAA/City of sorrow - > Group name with the association name AAA

Assocation name is usually 3 - 6 bytes.

Requirement is to remove the assoction name and keep only teh Group name.

Any suggestions on how I can achieve this?

Thanks
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 Jul 14, 2010 11:34 pm    Post subject:
Reply with quote

It's not clear what you want to do or what your data actually looks like.

Are the fields in fixed positions, or are they delimited in some way.

Please show a better example of the records in your input file and what you expect for output. Explain the rules for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of the relevant fields, or explain how the fields are delimited if appropriate.
Back to top
View user's profile Send private message
SORTQUERY

New User


Joined: 14 Jul 2010
Posts: 13
Location: United States

PostPosted: Thu Jul 15, 2010 12:21 am    Post subject:
Reply with quote

Input file is Lrecl- 70. It has Group name - position 1,70.
Few Group are associated with an association and have the association initials at the beginning of the name seperated by '/'.

Following is an example.

GROUP NAME 1
GROUP NAME 2
AAAA/GROUP NAME 3
BBB/GROUP NAME 4
CC/GROUP NAME 5
GROUP NAME 6
.
.
.

My output should be of lrecl = 70

GROUP NAME 1
GROUP NAME 2
GROUP NAME 3
GROUP NAME 4
GROUP NAME 5
GROUP NAME 6
.
.
.
I came up with the following -

Code:
SORT FIELDS=COPY                                       
OUTREC IFTHEN=(WHEN=(2,1,CH,EQ,C'/'),                     
             BUILD=(1:3,68,C'  ')),         
             IFTHEN=(WHEN=(3,1,CH,EQ,C'/'),                     
             BUILD=(1:3,67,C'   ')),         
             IFTHEN=(WHEN=(4,1,CH,EQ,C'/'),                     
             BUILD=(1:5,66,C'    ')),         
             IFTHEN=(WHEN=(5,1,CH,EQ,C'/'),                     
             BUILD=(1:6,65,C'     ')),         
             IFTHEN=(WHEN=(6,1,CH,EQ,C'/'),                     
             BUILD=(1:7,64,C'      ')),         


But this is with an assumption that the association Initials can be of max 6 bytes. This is true for almost all the cases os of now, but there is no check on the length, hence wanted a generic soln.

Let me know if more details are needed.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 15, 2010 1:00 am    Post subject: Reply to: Using Replace option
Reply with quote

use the following DFSORT JCL
Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD DSN=your input 70 byte FB file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                     
  INREC IFTHEN=(WHEN=(1,70,SS,EQ,C'/'),                 
  PARSE=(%=(ENDBEFR=C'/'),%1=(FIXLEN=70)),BUILD=(%1))   
//*
Back to top
View user's profile Send private message
SORTQUERY

New User


Joined: 14 Jul 2010
Posts: 13
Location: United States

PostPosted: Thu Jul 15, 2010 2:47 am    Post subject:
Reply with quote

Thanks Kolusu, this worked.

My original requirement was a bit different then what I have posted. Posting the origianl requirement for others to refer.

Following is my exact requirement -
Input File - Lrecl - 1100

I need 3 fields in my output file -
Group Number - position , 1050,9
Section - position 1058.4
Group name - position 33,70.

From the Group name - Remove certain special characters.

Following is the sort parm i developed with the forums help, which seems to be working fine.

Code:

  INREC IFTHEN=(WHEN=(33,70,SS,EQ,C'/'),                     
             PARSE=(%=(ENDBEFR=C'/'),%1=(FIXLEN=70)),     
             BUILD=(1:1050,9,10:1059,4,14:%1)),           
      IFTHEN=(WHEN=NONE,                                   
             BUILD=(1:1050,9,10:1059,4,14:33,70))         
    SORT FIELDS=COPY                                       
    OUTFIL FINDREP=(INOUT=(C'/',C' ',C'\',C'-',C'$',C' ', 
                           C':',C' ',C'.',C' ',C',',C' ', 
                           C'*',C' ',C'"',C' ',C'=',C'-', 
                           C'?',C' ',C'!',C' ',C'|',C' ', 
                           C'>',C' ',C'<',C' ',C';',C' '))


Thanks
Back to top
View user's profile Send private message
SORTQUERY

New User


Joined: 14 Jul 2010
Posts: 13
Location: United States

PostPosted: Thu Jul 15, 2010 6:59 pm    Post subject:
Reply with quote

Is there a way to apply the parsing for '/' only for the first 10 bytes of the Name field?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 15, 2010 10:13 pm    Post subject:
Reply with quote

SORTQUERY,

Change your IFTHEN statement to just look for first 10 bytes instead of 70 bytes.
Back to top
View user's profile Send private message
SORTQUERY

New User


Joined: 14 Jul 2010
Posts: 13
Location: United States

PostPosted: Sat Jul 17, 2010 2:07 am    Post subject:
Reply with quote

Thanks Again, icon_smile.gif
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 Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm

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