IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

help to develop a sort card for removing 12th and 15th digit


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Mon Aug 13, 2012 1:41 pm
Reply with quote

Can anybody help me out in developing a sort card to remove 12th and 15th digit from a number of 15 digits and replace the two spaces in the end of 13th digit and also first 4 digits will be spaces using sort utility.

Ex: 123400234126417 should look like ' 1234002341241 ' where number 6 and 7 got removed and two spaces at end and four spaces at begeining.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Aug 13, 2012 1:56 pm
Reply with quote

123400234126417 => 15 bytes

1234002341241 + 6 bytes of spaces => 19 bytes

Are you sure this is your requirement?

If yes

Do you need to remove 12th and 15th digit always?

If Yes
OUTREC FIELDS=(4X,5:1,11,16:13,2,18:13,2,2X)
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Mon Aug 13, 2012 2:19 pm
Reply with quote

Thank you so much. I used sort card OUTREC FIELDS=(4X,5:1,11,16:13,2,2X) to meet my requirement.

But after 19 digit number i am getting unwnted dots in my output file.How to remove those dots?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 13, 2012 2:40 pm
Reply with quote

Please show all your sort cards, sample input, expected output and output received.
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Mon Aug 13, 2012 2:41 pm
Reply with quote

Also please let me know what changes should i do to sort card to insert inverted coma at the begining and at the end of my 19 digit number string?
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Mon Aug 13, 2012 2:49 pm
Reply with quote

i/p: 001234567891012
o/p: 0012345678901 .......................................................................

sort card: SORT FIELDS=COPY
OUTREC FIELDS=(4X,5:1,11,16:13,2,2X)


my o/p is as expected but i don't need extra dots after last spaces. Also o/p should be within inverted comas.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Aug 13, 2012 3:12 pm
Reply with quote

Try this

Code:

      SORT FIELDS=COPY
      OUTREC FIELDS=(4X,5:C'''',6:1,11,17:13,2,19:C'''',61X)
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 13, 2012 3:51 pm
Reply with quote

Code:
  SORT FIELDS=COPY
  OUTREC BUILD=(4X,C'''',1,11,13,2,C'''',80:X)


I've changed FIELDS to BUILD, as FIELDS is somewhat "overloaded". Since all the data appears naturally at the position of the columns previously specified, I have removed the columns. To "pad" the record, put data in the last byte, unreferenced bytes will automatically be filled by DFSORT.

For "inverted commas" you may mean C'"'.
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Mon Aug 13, 2012 3:53 pm
Reply with quote

using these sort card i got o/p as:

'0012345678901' .My inverted comas must be before 1st four spaces and after 2 spaces at the ending.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Aug 13, 2012 3:55 pm
Reply with quote

Thanks Bill

Vidya,

I believe I had spoon fed you enough.Why not try to understand the card and change it to what is needed?
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Mon Aug 13, 2012 4:05 pm
Reply with quote

Thank you so much.

I got my o/p using sort card: OUTREC FIELDS=(1:C'''',4X,6:1,11,17:13,2,2X,21:C'''',59X)

icon_smile.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 13, 2012 4:06 pm
Reply with quote

Vidya,
As Pandora-Box indicates, you really should be able to do that bit yourself.

If you don't understand how, there are excellent manuals referenced in "stickies" at the top of this forum. Consult them, experiment, and understand what has been shown to you, then the final bit will be easy.

If you don't understand the sort card but go ahead with a solution, what are you going to do when someone asks you to change it? Or document it? Or how to do something similar since you've managed that one?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top