MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

shift to middle of record

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
relaxing
Beginner


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Tue Apr 03, 2007 10:52 am    Post subject: shift to middle of record Reply with quote

Gurus,

I need to shift the data to middle of record if it starts with @.
Input record lenght = 102, Output should be the same 102.

Input:
Code:

asdlasdjkl78897979879
@xgk
fjlklkljlkjljlksjdljlsdjkflsd

Ouput:
Code:

asdlasdjkl78897979879
blanks   @xgk blanks   
fjlklkljlkjljlksjdljlsdjkflsd


Regards,
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Apr 03, 2007 11:24 am    Post subject: Reply with quote

Since this sounds like a report, the easiest way would be with a Rexx exec.
Back to top
View user's profile Send private message Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Apr 03, 2007 11:45 am    Post subject: Reply with quote

relaxing,

when you say middle, do you want to adjust it based on the length of the field? ie.

the 2nd record which starts with @xgk is 4 bytes and if the field you are trying to center it is 20 bytes then @xgk would begin at pos 9 of 20 byte field.

But if you have 6 byte field then how do you want to center it ? i.e @12345

Let us know the conditions and may be we can suggest something

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
relaxing
Beginner


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Tue Apr 03, 2007 1:07 pm    Post subject: Reply with quote

Kolusu, the bytes should be centred in the record. The output should be like:

Output:
abcdefghijklmnopqrst
blanks @12345 blanks
abcdefghijklmnopqrst

But as semigeezer said if there is no direct function then I can go for a cobol/rexx program.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group