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!