IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to fill spacess in the OUTREC field


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
suneelv

New User


Joined: 26 Aug 2008
Posts: 52
Location: inida

PostPosted: Fri Nov 21, 2008 7:12 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Nov 21, 2008 7:39 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Nov 21, 2008 9:48 pm
Reply with quote

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
View user's profile Send private message
suneelv

New User


Joined: 26 Aug 2008
Posts: 52
Location: inida

PostPosted: Mon Nov 24, 2008 2:28 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top