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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Add a hex character X '0A' at the end of each record
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jul 31, 2008 9:55 pm    Post subject:
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    Post subject: Reply to: Add a hex character X '0A' at the end of each reco
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

Site Director


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

PostPosted: Thu Jul 31, 2008 10:17 pm    Post subject:
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: 8054
Location: East Dubuque, Illinois, USA

PostPosted: Thu Jul 31, 2008 10:44 pm    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Fri Aug 01, 2008 11:17 am    Post subject:
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: 8054
Location: East Dubuque, Illinois, USA

PostPosted: Fri Aug 01, 2008 4:51 pm    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Fri Aug 01, 2008 5:27 pm    Post subject:
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    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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


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