Page 1 of 1

JUNK CHARACTERS PRINTED WHEN USING LMCOPY FUNCTION IN REXX

PostPosted: Thu Sep 10, 2009 4:56 pm
by srn123
Hi,

I am trying to copy a parm (sort card) from one of my PDS members to a newly created member in another PDS using LMCOPY. The new member name is given by the user through an ISPF panel.

Below is the part of code that I used for LMCOPY. 'PARM' is given by the user which is passed as an argument. SORT PARM contains the skeleton of SORT commands( as given below)

"LMINIT DATAID(INDD1) DATASET('A888748.REXX.NEW')"
"LMINIT DATAID(OUTDD1) DATASET('TEST.MJRS.PARMLIB')"
"LMCOPY FROMID("INDD1") TODATAID("OUTDD1") FROMMEM(SORTPARM)
TOMEM("PARM") PACK"

SORTPARM -
***************************** Top of Data ******************************
SORT FIELDS=(1,8,CH,A)
SUM FIELDS=NONE
**************************** Bottom of Data ****************************

Question -

The copy happens correctly to the member as given by the user. But when I try to use this parm in a sort step, I get an abend. I saw in the spool that there are a few junk characters present. This is what the spool says -

SYSIN :
F & nSORT FIELDS=(1,8,CH,A) SUM FIELDS=NONE
*
Junk characters are printed before the SORT FIELDS and also the sum fields come in the same line. How do I remove this junk characters? I did a 'HEX ON' to see if there are any junk characters printed in 'PARM' while trying to copy. But there aren't any. Neither are there any junk in SORTPARM.

Different trials done -
1. I tried to give the sort commands inline in the sort step itself and it ran fine.
2. I manually wrote a parm with the above sort commands and ran the sort step pointing to the parm, it ran fine.

So, I came to the conclusion that this junk (might be a carraige return symbol or so) must have been caused by the
LMCOPY when trying to copy to a new member.

Could you please let me know what the problem is and how to eliminate the junk characters?

Thanks!

Re: JUNK CHARACTERS PRINTED WHEN USING LMCOPY FUNCTION IN REXX

PostPosted: Thu Sep 10, 2009 7:28 pm
by enrico-sorichetti
the wrong output is simply due to a misuse of the PACK keyword,
read about it in the manual

PACK is transparent to all that is done inside the ISPF environment ( edit/view/browse)
outside of it it looks like garbage

Re: JUNK CHARACTERS PRINTED WHEN USING LMCOPY FUNCTION IN REXX

PostPosted: Thu Sep 10, 2009 7:58 pm
by srn123
Thanks! it is working now.
I had one more question. Could you please tell me what PACK means. I mean why it is used for and why and when PACK OFF and PACK ON is used?

Re: JUNK CHARACTERS PRINTED WHEN USING LMCOPY FUNCTION IN REXX

PostPosted: Fri Sep 11, 2009 4:17 pm
by expat
I had one more question. Could you please tell me what PACK means. I mean why it is used for and why and when PACK OFF and PACK ON is used?

I am sure that the manual offers a better explanation than we can give you :mrgreen:

Re: JUNK CHARACTERS PRINTED WHEN USING LMCOPY FUNCTION IN REXX

PostPosted: Sat Sep 12, 2009 12:33 am
by dick scherrer
Hello,

Look at this page:
http://publibz.boulder.ibm.com/cgi-bin/ ... pzug70/5.9

It has been over 2 years and so far i have not managed to get links to the IBM manuals posted. . .

Sorry,

d