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 

Low values to spaces

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
js_praveen
Beginner


Joined: 09 Jan 2003
Posts: 20
Topics: 7

PostPosted: Mon Jan 20, 2003 11:27 pm    Post subject: Low values to spaces Reply with quote

Hi All,

I want to convert fields with low values to spaces in a file (10,000 records). Is it better do it in the JCL rather than doing it in the program? Please advice.

Thanks

JSP
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Jan 21, 2003 12:42 am    Post subject: Reply with quote

Praveen,

There are many of ways of doing it. The easiest would be using utilities like DFSORT, FILE-AID. The following DFSORT jcl will give you the desired results.There is a new feature TRAN=ALTSEQ with the latest PTF which will replace low values with spaces.Be careful with this kind of replacement as it will mess up packed or binary fields that have hex zeros in the first couple of bytes.

Method:1

Code:

//STEP0100 EXEC PGM=ICEMAN
//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)
/*


Method:2 File-aid 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')
/* 


If you want to do it programatically then use INSPECT


Hope this helps...

Cheers

kolusu


Last edited by kolusu on Tue Jan 21, 2003 12:54 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Grant
Beginner


Joined: 02 Dec 2002
Posts: 45
Topics: 1
Location: Sydney, NSW, Australia

PostPosted: Tue Jan 21, 2003 12:52 am    Post subject: Reply with quote

Six of one half dozen of another.

My first thought was to use a utility (such as FileAid) to convert the data in a separate step, but the Inspect statement (assuming you are using Cobol) is pretty slick when both strings are constants (i.e. x'00' and x'40') .

Code:

Inspect xxxxx replacing all x'00' by x'40'.

generated code:
000036  INSPECT                                         
    00034E  DCC7 2000 A030          TR   0(200,2),48(10)

Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Tue Jan 21, 2003 11:09 am    Post subject: Reply with quote

For more information on the TRAN=ALTSEQ option of DFSORT, see the "Change all zeros in your records to spaces" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

DFSORT options TRAN=UTOL and TRAN=LTOU are also available to change uppercase to lowercase or lowercase to uppercase, respectively. For more information, see the "Change uppercase to lowercase or lowercase to uppercase" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
_________________
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
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Thu Aug 07, 2008 4:10 pm    Post subject: Reply with quote

With z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can now use FINDREP to do this kind of thing, e.g.

Code:

    OPTION COPY
    INREC FINDREP=(IN=X'00',X'40')


For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
_________________
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 -> Job Control Language(JCL) 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