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 

Convert low-values to spaces and vice-versa

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> JCL/SORT
View previous topic :: View next topic  
Author Message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Dec 01, 2005 9:52 am    Post subject: Convert low-values to spaces and vice-versa Reply with quote

Is it possible to convert an EBCDIC character to another EBCDIC character Using SORT ?

The answer is Yes. The simplest way is to use DFSORT's TRAN=ALTSEQ operand with the ALTSEQ statement. (If you are using Syncsort then you need to have the latest version that supports the TRAN=ALTSEQ feature.)

Case 1: Convert All Low-values to Spaces

Sort Solution

Code:

//R010    EXEC  PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//SORTOUT  DD DSN=YOUR OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),                 
//            UNIT=SYSDA,                             
//            SPACE=(CYL,(X,Y),RLSE)   
//SYSIN DD * 
  OPTION COPY
  ALTSEQ CODE=(0040)
  OUTREC FIELDS=(1,LRECL,TRAN=ALTSEQ)
/*


Fileaid Solution:

Code:

//STEP0100 EXEC PGM=FILEAID                           
//SYSPRINT DD SYSOUT=*                                 
//DD01     DD DSN=YOUR INPUT DATASET,
//            DISP=SHR
//DD01O    DD DSN=OUTPUT DATASET,             
//            DISP=(NEW,CATLG,DELETE),                 
//            UNIT=SYSDA,                             
//            SPACE=(CYL,(X,Y),RLSE),                 
//            DCB=(RECFM=FB,LRECL=ZZZ,BLKSIZE=0)       
//SYSIN    DD  *                                       
$$DD01 COPY REPLALL=(1,0,X'00',X'40')
/* 


Case 2: Convert Spaces to Low-values - You just have to change the Hex Character order in ALTSEQ code.

Sort Solution

Code:

//R010    EXEC  PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//SORTOUT  DD DSN=YOUR OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),                 
//            UNIT=SYSDA,                             
//            SPACE=(CYL,(X,Y),RLSE)   
//SYSIN DD * 
  OPTION COPY
  ALTSEQ CODE=(4000)
  OUTREC FIELDS=(1,LRECL,TRAN=ALTSEQ)
/*


Fileaid Solution:

Code:

//STEP0100 EXEC PGM=FILEAID                           
//SYSPRINT DD SYSOUT=*                                 
//DD01     DD DSN=YOUR INPUT DATASET,
//            DISP=SHR
//DD01O    DD DSN=OUTPUT DATASET,             
//            DISP=(NEW,CATLG,DELETE),                 
//            UNIT=SYSDA,                             
//            SPACE=(CYL,(X,Y),RLSE),                 
//            DCB=(RECFM=FB,LRECL=ZZZ,BLKSIZE=0)       
//SYSIN    DD  *                                       
$$DD01 COPY REPLALL=(1,0,X'40',X'00')
/* 


Without Using ALTSEQ
There is another way to accomplish this without using ALTSEQ - which uses CHANGE operator of SORT. But coding the control card for this is a bit tedious.

Check this link for example: http://www.mvsforums.com/helpboards/viewtopic.php?p=6728#6728


Related Links:
http://www.mvsforums.com/helpboards/viewtopic.php?p=1454#1454
http://www.mvsforums.com/helpboards/viewtopic.php?p=16108#16108
http://www.mvsforums.com/helpboards/viewtopic.php?t=4932&highlight=altseq

Thanks,
Phantom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> JCL/SORT 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