Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to fill spacess in the OUTREC field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to fill spacess in the OUTREC field
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: 8593
Location: Back in jolly old England

PostPosted: Fri Nov 21, 2008 7:39 pm    Post subject:
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 Moderator


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

PostPosted: Fri Nov 21, 2008 9:48 pm    Post subject:
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    Post subject: Reply to: How to fill spacess in the OUTREC field
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us