Page 1 of 1

Using System symbols in SORT

PostPosted: Fri Jun 08, 2012 6:46 pm
by mfrookie
I have been trying to use system symbols in a SORT job, but unfortunately haven't been successful completely.

Some of the systm symbols I tried like &SYSPLEX, &SYSNAME, &LHHMMSS work perfectly. But when I try &SYSUID, I don't see SYSUID being replaced by the actual user id. Instead I see a string in output
as '&SYSUID'.

I am trying to generate a JOB and want the person's user id to be used in the jobname along with 2 byte constant.

Here is the job that I have been using.
//REARRJCL EXEC PGM=SORT,COND=(0,NE)
//SORTIN   DD   *
1
/*
//SYMNAMES DD   *
WK-SYSUID,S'&SYSUID'
WK-SYSPLEX,S'&SYSPLEX'
WK-LHHMMSS,S'&LHHMMSS'
/*
//SORTOUT  DD   SYSOUT=*
//SYSIN    DD   *
  INREC FIELDS=(C'WK-SYSUID : ',WK-SYSUID,
                C' WK-SYSPLEX : ',WK-SYSPLEX,
                C' WK-LHHMMSS : ',WK-LHHMMSS)
  SORT FIELDS=COPY
/*
//SYMNOUT  DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*


And here is the output I see.
WK-SYSUID : &SYSUID WK-SYSPLEX : UKMC1 WK-LHHMMSS : 205609


Can someone please help, is there anything wrong I am doing.

Thanks.

Re: Using System symbols in SORT

PostPosted: Fri Jun 08, 2012 6:56 pm
by Akatsukami
Symbolics cannot be used in control cards; you need to devise another way of generating your SYMNAMES data.

Re: Using System symbols in SORT

PostPosted: Fri Jun 08, 2012 7:07 pm
by mfrookie
Akatsukami wrote:Symbolics cannot be used in control cards; you need to devise another way of generating your SYMNAMES data.


Hi,

I didn't get what you are trying to say. If you see the SYSPLEX and LHHMMSS values are properly getting resolved but SYSUID is not getting resolved.

Re: Using System symbols in SORT

PostPosted: Fri Jun 08, 2012 7:40 pm
by MrSpock
&SYSUID is not a system symbolic. These are:

http://publibz.boulder.ibm.com/cgi-bin/ ... E241/2.2.2

Re: Using System symbols in SORT

PostPosted: Fri Jun 08, 2012 7:57 pm
by mfrookie
MrSpock wrote:&SYSUID is not a system symbolic. These are:

http://publibz.boulder.ibm.com/cgi-bin/ ... E241/2.2.2



Hello Mr. Spock,

I did check those symbols, but I was under impression that even the ones mentioned in following link are part of system symbols. It seems I am wrong. Because I tried &SID which is not part of static or dynamic symbols list and it didn't work.

http://publibz.boulder.ibm.com/cgi-bin/ ... 1025161613

Re: Using System symbols in SORT

PostPosted: Fri Jun 08, 2012 8:29 pm
by Robert Sample
The manual you quoted specifically says the symbols, which include &SID and &SYSUID cannot be specified in the system symbol table because they are reserved by the operating system. That does not mean those values are system symbols -- it means they cannot be specified as system symbols.

Re: Using System symbols in SORT

PostPosted: Fri Jun 08, 2012 8:30 pm
by NicC
There are other ways of getting these symbols into your control cards but you need to pass them as parameters to a program (a short Rexx program will do) which will generate the data for your //SYMNAMES DD statement. Examples appear in various parts of the forum.

Re: Using System symbols in SORT

PostPosted: Mon Jun 11, 2012 4:39 pm
by mfrookie
Thanks to everyone for the clarifications.

I will look for another way to get them in my SORT JOB.

Thanks.