Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8620
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: 8201
Location: Dubuque, Iowa, 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: 6970
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: 8201
Location: Dubuque, Iowa, 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: 6970
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 query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us