View previous topic :: View next topic
|
Author |
Message |
suneelv
New User
Joined: 26 Aug 2008 Posts: 52 Location: inida
|
|
|
|
Hi,
I want to display literal before each record, that is maximum of 20 chars.
if i mentioned 12 chars..the remaining 8bytes fill with dots in the end of the record, the input file is lrecl of 500 and out put file is lrecl of 520.
here my question is how to fill the 8 spaces after literal instead of last record.
i tried the below control card
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(C'"ABCDEFGHI",X'BBBBBBBB',1,500)
/*
but it failed. could you anyone help in this.
Regards
Suneel |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Using DFSORT, this puts a literal in the first 20 bytes in front of the 80 byte record and has no dots in the literal field, or at the end of the record.
80 byte JCL code gets prefixed with ABCDEF padded with blanks to the end of the literal field, and then the JCL record.
Code: |
SORT FIELDS=COPY
OUTREC BUILD=(C'ABCDEF',21:1,80)
|
This should also work for SYNCSORT (I think). |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Suneel,
You can use nX, nC' ' or nX'40' to insert n spaces, e.g.
Code: |
OUTREC BUILD=(C'123456789012',8X,1,500)
|
Alternatively, you can use c: to give the next column for the output record and spaces will be filled in, e.g.
Code: |
OUTREC BUILD=(C'123456789012',21:1,500)
|
Note that what you've specified:
Code: |
OUTREC FIELDS=(C'"ABCDEFGHI",X'BBBBBBBB',1,500)
|
is invalid syntax as it has an odd number of apostrophes. What constant are you actually trying to code here? |
|
Back to top |
|
|
suneelv
New User
Joined: 26 Aug 2008 Posts: 52 Location: inida
|
|
|
|
Hi,
Thanks a lot for all your suggestions.
the below control card working fine.
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(C'"ABCDEFGHI",',13:8X,1,500)
regards
suneel |
|
Back to top |
|
|
|