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

SORT to insert spaces in a field


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

New User


Joined: 13 Sep 2005
Posts: 35
Location: India

PostPosted: Wed Dec 21, 2005 2:50 pm
Reply with quote

Hi
I needed syntax for a sort JCL in wich i want to move spaces to a particular field for another field
e.g
i have a file in which i have different fields like INPUT-ID,
COMPANY CODE,YEAR,ETC ETC
SO FOR INPUT ID-SOME VALUE I WANT SPACES TO BE MOVED TO COMPANY CODE
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Wed Dec 21, 2005 3:09 pm
Reply with quote

Could you show us a concret example, please ?

Alain
Back to top
View user's profile Send private message
rinkubhat

New User


Joined: 13 Sep 2005
Posts: 35
Location: India

PostPosted: Wed Dec 21, 2005 3:20 pm
Reply with quote

Hi Alian
Consider a file with ten records WITH RECORD LENGTH 15
The field names of the file are COMPANY CODE;INPUT-ID,ACCOUNTING-DATE;LOCATION ETC.
NOW FOR INPUT-ID-82MP IN THIS PARTICULAR FILE I WANT SPACES TO BE MOVED TO COMPANY CODE.

I GUESS THIS IS CLEAR
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Wed Dec 21, 2005 3:46 pm
Reply with quote

Rinku,

Its possible with OUTREC FIELDS option try that if you haven't tried.

Please let me know if you required more.

Regards
Jai
Back to top
View user's profile Send private message
rinkubhat

New User


Joined: 13 Sep 2005
Posts: 35
Location: India

PostPosted: Wed Dec 21, 2005 3:49 pm
Reply with quote

Hi Jai
Could u explain in detail the syntax
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Wed Dec 21, 2005 3:56 pm
Reply with quote

Rinku,
outrec is used to reformat the record.
Suppose your record length is 80 bytes. and you want in new record format in the some field position with spaces.
if i want from postion 10 to 15 as spaces.

then outrec looks as

outrec fields=(1,9,10:6,c' '16,65)

hope this helps

regards
jai
Back to top
View user's profile Send private message
rinkubhat

New User


Joined: 13 Sep 2005
Posts: 35
Location: India

PostPosted: Wed Dec 21, 2005 4:49 pm
Reply with quote

Jai
Thanks your OUTREC funda helped
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Dec 21, 2005 9:49 pm
Reply with quote

Quote:
outrec fields=(1,9,10:6,c' '16,65)


This is not the correct syntax for the OUTREC statement. Two of the many forms of the correct syntax would be:

Code:

   OUTREC FIELDS=(1,9,10:6C' ',16,65)

or

   OUTREC FIELDS=(1,9,6X,16,65)


6C' ' and 6X both mean 6 blanks.

But an easier way to do this is with DFSORT's OVERLAY feature like this:

Code:

   OUTREC OVERLAY=(10:6X)


With overlay, you only have to specify the data you want to change.

You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's OVERLAY function. Only DFSORT has this function, so if you don't have DFSORT, you won't be able to use it. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:

Use [URL] BBCode for External Links

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
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
Search our Forums:

Back to Top