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: 7935
Location: Bellevue, IA

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: 6966
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: 7935
Location: Bellevue, IA

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: 6966
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 How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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