Page 1 of 1

Need to add space to a value

PostPosted: Fri Jul 22, 2011 2:26 am
by rjambu
I'm trying to insert space between the date and the time in the 7th column value, below is the JCL i tried, which is giving an error can anyone help me in this regard?

Thanks
jr

input file
ABCD2173|SAMPLE STAT1|VENDOR1 Status|ABC_12|00000000|0.000 |2010-12-0200:00:00.00000|20060101|00000000|
BCDE3150|SAMPLE STAT2|VENDOR2 Status|XYZ_22|00000000|0.000 |2010-12-0200:00:00.00000|20201010|00000000|


Required o/p

ABCDSAMPLE STAT1                  VENDOR1 Status                ABC000000000.000     2010-12-02 00:00:00.000002006010100000000
BCDESAMPLE STAT2                  VENDOR2 Status                XYZ000000000.000     2010-12-02 00:00:00.000002020101000000000


JCL
//STEP010 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD  DSN=USER1.ABC.SRCD,DISP=SHR 
//SORTOUT  DD  DSN=USER1.TARGET.ABC,         
//             UNIT=DISK,SPACE=(TRK,(1,2),RLSE),           
//             DISP=(NEW,CATLG,DELETE)                                                                     
//SYSIN    DD  *                                                   
  SORT FIELDS=COPY                                                   
  INREC PARSE=(%00=(ENDBEFR=C'|',FIXLEN=04),                         
              %01=(ENDBEFR=C'|',FIXLEN=30),                         
              %02=(ENDBEFR=C'|',FIXLEN=30),                         
              %03=(ENDBEFR=C'|',FIXLEN=03),                             
              %04=(ENDBEFR=C'|',FIXLEN=08),                             
              %05=(ENDBEFR=C'|',FIXLEN=10),                             
              %06=(ENDBEFR=C'|',FIXLEN=25),                             
              %07=(ENDBEFR=C'|',FIXLEN=08),                             
              %08=(ENDBEFR=C'|',FIXLEN=08)),                             
  BUILD=(%00,%01,%02,%03,%04,%05,%06,UFF,EDIT=(TTTTTTTTT TTTTTTTTTTTTTT),%07,%08)                 
/*

Re: Need to add space to a value using SORT JCL

PostPosted: Fri Jul 22, 2011 2:51 am
by dick scherrer
Hello,

Very good start :)

We also need to see all the informational output generated (including the message id's).

Re: Need to add space to a value

PostPosted: Fri Jul 22, 2011 6:18 pm
by rjambu
Hi,
It gives an syntax error message

Is there any syntax or ASCII Value to insert space?

Thanks,
jr

SYSOUT
            BUILD=(%00,%01,%11,UFF,EDIT=(TTTTTTTTT TTTTTTTTTTTTTT)                 X
                                                  $                             
ICE007A F SYNTAX ERROR                                                         
                %03,%02,%04,%05,%06,%07,%08)
ICE751I 0 C5-K90025 C6-K90025 C7-K54603 C8-K62201 E7-K62201                     
ICE052I 3 END OF DFSORT                                                         


Re: Need to add space to a value

PostPosted: Fri Jul 22, 2011 6:23 pm
by Robert Sample
Is there any syntax or ASCII Value to insert space?
Why do you want an ASCII value? Mainframes which use JCL use EBCDIC, so an ASCII space character (X'20') is totally different than an EBCDIC space value (X'40').

Re: Need to add space to a value

PostPosted: Fri Jul 22, 2011 7:17 pm
by rjambu
My Requirement is make this column value
2010-12-0100:00:00.00000
to
2010-12-01 00:00:00.00000

the source data for this column is having timestamp value that does not have space between the date and the time value , So i need to reformat this column by inserting space in 11 position.


Thanks,
jr

Re: Need to add space to a value

PostPosted: Fri Jul 22, 2011 7:36 pm
by NicC
Why not treat the field as 2 fields (which it is), date field and time field, and ouput them seperately with a blank between?

Re: Need to add space to a value

PostPosted: Fri Jul 22, 2011 9:20 pm
by Ed Goodman
Try putting the edit mask in single quotes:
EDIT=('TTTTTTTTT TTTTTTTTTTTTTT')

This is in my manual (PDF page 320 in ice1ca50.pdf), but it may invoke some other processing that gives different results.

Re: Need to add space to a value

PostPosted: Fri Jul 22, 2011 9:22 pm
by skolusu
rjambu,

Use the following control cards.

//SYSIN    DD  *                                         
  SORT FIELDS=COPY                                       
  INREC PARSE=(%00=(ENDBEFR=C'|',FIXLEN=04),             
               %01=(ENDBEFR=C'|',FIXLEN=30),             
               %02=(ENDBEFR=C'|',FIXLEN=30),             
               %03=(ENDBEFR=C'|',FIXLEN=03),             
               %04=(ENDBEFR=C'|',FIXLEN=08),             
               %05=(ENDBEFR=C'|',FIXLEN=10),             
               %06=(FIXLEN=10),                         
               %07=(ENDBEFR=C'|',FIXLEN=15),             
               %08=(ENDBEFR=C'|',FIXLEN=08),             
               %09=(ENDBEFR=C'|',FIXLEN=08)),           
        BUILD=(%00,%01,%02,%03,%04,%05,%06,X,%07,%08,%09)
//*