Page 1 of 1

convert junk values to spaces

PostPosted: Thu Dec 13, 2012 8:11 pm
by mirunalK
I am converting the PD fields in a flat file to external decimals.
I need to convert junk values at the field defined as fillers A (143) (length 143 ) to spaces. from 2478.. 143 length has been defined as filler but it had junk values and the same was written to the output at length 2723. Could some one tell me the syntax to convert this junk value to spaces.
I have attached the screen shot of the junk value.

2723:2478,143,

Re: convert junk values to spaces

PostPosted: Thu Dec 13, 2012 8:30 pm
by Akatsukami
mirunalK wrote:I am converting the PD fields in a flat file to external decimals.
I need to convert junk values at the field defined as fillers A (143) (length 143 ) to spaces. from 2478.. 143 length has been defined as filler but it had junk values and the same was written to the output at length 2723. Could some one tell me the syntax to convert this junk value to spaces.
I have attached the screen shot of the junk value.

Please note that many here cannot or will not download attached files, for security or other reasons. Copy the screen from your emulator and paste it, enclosing it in Code tags
so it  looks   like    this

Note that the Code tags use a fixed-pitch font and do not squeeze out multiple spaces, thus preserving alignment.

Your request is a bit dubious. By "junk values" I presume you mean "non-alphameric glyphs" (unlike toy computers, mainframes use non-printable data quite frequently). Are you sure that these "junk values" are not important data?

Re: convert junk values to spaces

PostPosted: Thu Dec 13, 2012 9:06 pm
by dick scherrer
Hello,

I need to convert junk values at the field defined as fillers A (143) (length 143 ) to spaces. from 2478.. 143 length has been defined as filler but it had junk values and the same was written to the output at length 2723.
I do not understand this at all . . .

If the field(s) are "filler", why does the content matter?

Why has the length changed?

There are no "junk" values every bit pattern from x'00' to x'FF' is valid. May not be what you want, but is still valid.

Re: convert junk values to spaces

PostPosted: Thu Dec 13, 2012 11:55 pm
by c62ap90
I cannot download your attachment at work but maybe this JCL I did recently to convert certain characters to space (i.e. X'BA' to X'40') can help. Good luck!

//*--            BA,BB,CC,CD,9A,00,AF,0D,25,B8,B2,90,51,54,9E,DF,50   
//*--            CONVERT ALL THE ABOVE HEX CHARACTERS TO SPACES.     
//*-------------------------------------------------------------------
//*                                                                   
//STEP010  EXEC PGM=SORT                   
//SYSOUD   DD SYSOUT=*                                               
//SYSOUT   DD SYSOUT=*                                               
//SYSPRINT DD SYSOUT=*                                               
//SORTIN   DD DSN=<see example input below>, 
//            DISP=SHR                                               
//SORTOUT  DD DSN=<see example output below>,         
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=(TEST,1),                                         
//            SPACE=(TRK,(15,15),RLSE),                               
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)                       
//SYSIN    DD *                                           
   OPTION COPY                                             
   OUTREC FIELDS=(1,80,TRAN=ALTSEQ)                       
   ALTSEQ CODE=(BA40,BB40,CC40,CD40,9A40,0040,AF40,0D40,   
     2540,B840,B240,9040,5140,5440,9E40,DF40,5040)         
/*                                                         
//                                                         


Input:
-----------------------------------------------------------------------
Switch to hex to see BA,BB,CC,CD,9A,00,AF,0D,25,B8,B2,90,51,54,9E,DF,50
EA8A884A9488A4A94A884CC6CC6CC6CC6FC6FF6CC6FC6FF6CF6CF6FF6FF6FF6FC6CC6FF4
26933803608570360255021B22B33B34B91B00B16B04B25B28B22B90B51B54B95B46B500
 -----------------------------------------------------------------------
A[B]CöDòEªF.G®H.I.J½K¥L°MéNèOÆPÿQ&R S T U V W X Y Z                     
CBCBCCCCC9C0CAC0C2DBDBD9D5D5D9DDD5D4E4E4E4E4E4E4E4E444444444444444444444
1A2B3C4D5A607F8D9318223041546E7F8090203040506070809000000000000000000000
 -----------------------------------------------------------------------


Output:
----------------------------------------------------------------------
Switch to hex to see BA,BB,CC,CD,9A,00,AF,0D,25,B8,B2,90,51,54,9E,DF,50
EA8A884A9488A4A94A884CC6CC6CC6CC6FC6FF6CC6FC6FF6CF6CF6FF6FF6FF6FC6CC6FF
26933803608570360255021B22B33B34B91B00B16B04B25B28B22B90B51B54B95B46B50
 ----------------------------------------------------------------------
A B C D E F G H I.J K L M N O P Q R S T U V W X Y Z                   
C4C4C4C4C4C4C4C4C2D4D4D4D4D4D4D4D4D4E4E4E4E4E4E4E4E44444444444444444444
10203040506070809310203040506070809020304050607080900000000000000000000
 ----------------------------------------------------------------------

Re: convert junk values to spaces

PostPosted: Fri Dec 14, 2012 4:17 pm
by mirunalK
Thanks All.. I just tried the following and felt it worked..

SORT FIELDS=COPY
OUTREC OVERLAY=(2723:143X)