Need to add space to a value



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Need to add space to a value

Postby rjambu » Fri Jul 22, 2011 2:26 am

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)                 
/*
rjambu
 
Posts: 27
Joined: Tue Feb 08, 2011 7:59 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Fri Jul 22, 2011 2:51 am

Hello,

Very good start :)

We also need to see all the informational output generated (including the message id's).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Need to add space to a value

Postby rjambu » Fri Jul 22, 2011 6:18 pm

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                                                         

rjambu
 
Posts: 27
Joined: Tue Feb 08, 2011 7:59 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need to add space to a value

Postby Robert Sample » Fri Jul 22, 2011 6:23 pm

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').
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Need to add space to a value

Postby rjambu » Fri Jul 22, 2011 7:17 pm

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
rjambu
 
Posts: 27
Joined: Tue Feb 08, 2011 7:59 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need to add space to a value

Postby NicC » Fri Jul 22, 2011 7:36 pm

Why not treat the field as 2 fields (which it is), date field and time field, and ouput them seperately with a blank between?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Need to add space to a value

Postby Ed Goodman » Fri Jul 22, 2011 9:20 pm

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.
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: Need to add space to a value

Postby skolusu » Fri Jul 22, 2011 9:22 pm

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)
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post