Issue with concatenation



IBM's Command List programming language & Restructured Extended Executor

Re: Issue with concatenation

Postby enrico-sorichetti » Wed Nov 21, 2012 1:18 pm

did You notice that people replying use the code tags ???

text displayed with the code tags uses a fixed font,
making easier for the people who spend their time helping You to understand Your code

the same with the code tags


text displayed  with the code tags uses a  fixed font, 
making easier for the people who spend their time helping You to understand Your code
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

These users thanked the author enrico-sorichetti for the post:
chenky (Fri Nov 23, 2012 5:52 pm)
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Issue with concatenation

Postby BillyBoyo » Wed Nov 21, 2012 1:21 pm

Also, since you've insisted on copying 80 columns, you are getting lots of spurious blank lines once Code'd. If you use the Code button and the Preview button, you can make everything look its best for those wanting to assist you.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Issue with concatenation

Postby chenky » Wed Nov 21, 2012 1:22 pm

Ok will follow Enrico,BillyBoyo
chenky
 
Posts: 16
Joined: Tue Nov 20, 2012 4:59 pm
Has thanked: 7 times
Been thanked: 0 time

Re: Issue with concatenation

Postby Pedro » Mon Nov 26, 2012 10:32 pm

Repeating:
you need to strip off the trailing blanks.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Issue with concatenation

Postby Pedro » Mon Nov 26, 2012 10:34 pm

I have made all the changes as mentioned

I do not believe you made all of the changes that were suggested.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Issue with concatenation

Postby Pedro » Tue Nov 27, 2012 12:22 am

you need to strip off the trailing blanks.

Perhaps I did not give enough explanation for a beginner forum:
  • In your program, you read a file with EXECIO and put the records in the INPI. stem.
  • If the file has LRECL=80, each row of the INPI. stem will have 80 characters.
  • when you do your string concatenation, it will be as if you did something like this:
    queue "//         DD DSN=MY.DSN                    "||"TST"
  • the string concatenation creates a record about 95 characters long.
  • lets say the dataset name is in column 1 and is 30 characters long... there are 50 other characters that need to be removed.
  • If the dataset name is not in column 1, you have to remove leading characters also.
  • The EXECIO for OUTO probably truncates your records at 80 characters and you never see the last few characters.
Pedro Vera

These users thanked the author Pedro for the post:
chenky (Tue Nov 27, 2012 9:57 am)
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Issue with concatenation

Postby chenky » Tue Nov 27, 2012 9:56 am

Thanks alot Pedro ...I am able to generate the required O/P, what you have mentioned in above reply is absolotely right. The record length of the input file is 80 and Output file record length is also 80 ..which made blanks at the end..I have reduced the input file LRECL to 19 which is the exact size of file and I got the O/P ..again thanks for being patient with me.
chenky
 
Posts: 16
Joined: Tue Nov 20, 2012 4:59 pm
Has thanked: 7 times
Been thanked: 0 time

Re: Issue with concatenation

Postby chenky » Tue Nov 27, 2012 9:57 am

And thanks to every one for spending time ..
chenky
 
Posts: 16
Joined: Tue Nov 20, 2012 4:59 pm
Has thanked: 7 times
Been thanked: 0 time

Re: Issue with concatenation

Postby enrico-sorichetti » Tue Nov 27, 2012 12:07 pm

why not simply use
STRIP(inpi.i," ","T")
to get rid of the trailing blanks,
or even better use
STRIP(SUBSTR(inpi.i,1,71)," ","T)
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

These users thanked the author enrico-sorichetti for the post:
chenky (Thu Dec 06, 2012 11:16 am)
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Previous

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post