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

Add a hex character X '0A' at the end of each record


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

New User


Joined: 16 Jul 2006
Posts: 21
Location: delhi

PostPosted: Thu Jul 31, 2008 8:47 pm
Reply with quote

I have a file which is 32756 VB length file. The actual data in this file again is varied length. For example, first record is 841 length and second record is 994 etc. I want to add a hex character X '0A' at the end of each record. Can you help me with this?
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Jul 31, 2008 9:55 pm
Reply with quote

What happens should one or more records be a length of 32756 ?
Back to top
View user's profile Send private message
amalraj_ece

New User


Joined: 16 Jul 2006
Posts: 21
Location: delhi

PostPosted: Thu Jul 31, 2008 10:04 pm
Reply with quote

I have to do this through JCL (may be through SAS or Sort or any other utility).
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 31, 2008 10:17 pm
Reply with quote

Hello,

I berlieve you misunderstood Expat's queston.

What happens when the record is already the maximum length before the x'0A' is appended?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 31, 2008 10:44 pm
Reply with quote

This is easy to do in SAS as long as none of the records are already 32756 bytes long.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 01, 2008 11:17 am
Reply with quote

so what is the easy SAS solution when a record is 32756 before the addition of the extra byte to add the linefeed?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 01, 2008 4:51 pm
Reply with quote

Code:
DATA _NULL_;
LENGTH DATALINE $ 32767;
INFILE DDIN LENGTH=RL;
INPUT @;
RECLEN = RL;
INPUT @1 DATALINE $VARYING. RECLEN;
SUBSTR(DATALINE, RECLEN+1, 1) = '0A'X;
RECLEN + 1 ;
FILE DDOUT;
PUT DATALINE $VARYING. RECLEN;
and as I said
Quote:
as long as none of the records are already 32756 bytes long.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 01, 2008 5:27 pm
Reply with quote

Robert,

My question was _ what happens when a record is already at max length?
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top