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 Profile Log in to check your private messages Log in
 
SORT to insert spaces in a field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: SORT to insert spaces in a field
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    Post subject:
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    Post subject: Re: SORT
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    Post subject: Re: SORT
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    Post subject: Re: SORT
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    Post subject: Re: SORT
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    Post subject: Re: SORT
Reply with quote

Jai
Thanks your OUTREC funda helped
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 Dec 21, 2005 9:49 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/

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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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