MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DFSORT: convert spaces to packed zero

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Sterling Price
Beginner


Joined: 30 Aug 2004
Posts: 19
Topics: 8

PostPosted: Wed Dec 22, 2004 10:29 am    Post subject: DFSORT: convert spaces to packed zero Reply with quote

Greetings,

I hope this question hasn't already been answered elsewhere. I did the searches I could think of and didn't find anything.

I have an LRECRL=80 file in which I need to convert columns 50-56 to a packed field with a value of zero, but only if columns 50-56 contain spaces (i.e. x'40404040404040'). If the records don't contain spaces in these positions I don't want to change anything.

Here is an example:

[code:1:9b4c0ffb05]
4444444
0000000
-------
..
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Wed Dec 22, 2004 11:29 am    Post subject: Reply with quote

Sterling price,

Try this JCL,

Code:

//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=your input dsn,
              DISP=SHR                           
//SORTOUT  DD DSN=YOUR OUTPUT DSN,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  OUTREC FIELDS=(1,49,                                               
                 50,7,CHANGE=(7,X'40404040404040',X'0000000000000C'),   
                 NOMATCH=(50,7),57,24)                               
/*                                                                 


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sterling Price
Beginner


Joined: 30 Aug 2004
Posts: 19
Topics: 8

PostPosted: Wed Dec 22, 2004 12:01 pm    Post subject: Reply with quote

It works...thank you kolusu.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Wed Dec 22, 2004 12:10 pm    Post subject: Reply with quote

Quote:

I hope this question hasn't already been answered elsewhere. I did the searches I could think of and didn't find anything.


Sterling price ,

Yes indeed it was answered here Mr. Green

http://www.mvsforums.com/helpboards/viewtopic.php?t=3066&highlight=change

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Dec 22, 2004 1:00 pm    Post subject: Reply with quote

With z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004), you can also do this using the new IFTHEN and OVERLAY parameters as follows:

Code:

//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  SORT FIELDS=COPY
  OUTREC IFTHEN=(WHEN=(50,7,CH,EQ,C' '),
     OVERLAY=(50:+0,TO=PD,LENGTH=7))
/*


IFTHEN is a lot more powerful then CHANGE.

For complete details on the new DFSORT and ICETOOL functions available with these PTFs, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group