How to add data in last position or any specific position in sequential dataset thru rexx?
Or is there any syntax thru which I can give exactly number of spaces while writing in sequential dataset.
[ Post made via Android ]
How to add data in last position or any specific position in sequential dataset thru rexx?
Moderator: mickeydusaor
-
- Global Moderator
- Posts: 838
- Joined: Wed Sep 11, 2013 3:57 pm
Re: How to add data in last position or any specific position in sequential dataset thru rexx?
the exact syntax depends on how You are building the record, and the alignment.
here are two alternatives
the last field is left aligned
the last field is right aligned
the tested snippet
the output
here are two alternatives
the last field is left aligned
Code: Select all
a_sequence_of_fields_padded_with_blanks.....................morechars...........
lrecl=80
lhead=60
part1="a_sequence_of_fields_padded_with_blanks"
part2="morechars"
xx= left( left( part1, lhead ) || part2, lrecl)
the last field is right aligned
Code: Select all
another_sequence_of_fields_padded_with_blanks..........................morechars
lrecl=80
part1="another_sequence_of_fields_padded_with_blanks"
part2="morechars"
xx= part1 || right( part2, lrecl-length(part1) )
the tested snippet
Code: Select all
#! /usr/bin/env rexx
lrecl=80
lhead=60
part1="a_sequence_of_fields_padded_with_blanks"
part2="morechars"
xx= left( left( part1, lhead ) || part2, lrecl)
say ">>>"length(xx)
say ">>>"xx"<<<"
lrecl=80
part1="another_sequence_of_fields_padded_with_blanks"
part2="morechars"
xx= part1 || right( part2, lrecl-length(part1) )
say ">>>"length(xx)
say ">>>"xx"<<<"
Code: Select all
>>>80
>>>a_sequence_of_fields_padded_with_blanks morechars <<<
>>>80
>>>another_sequence_of_fields_padded_with_blanks morechars<<<
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
Re: How to add data in last position or any specific position in sequential dataset thru rexx?
Thank you so much Enrico. I am going through them. Great help.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute