|
View previous topic :: View next topic
|
| Author |
Message |
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
Hi
I have a question. Can the symbols defined in SYMNAMES dataset be used to create a file name based on the value from SYMNAMES dataset?
e.g.
I have defined the below symbols.
| Code: |
REPORT-ID,*,12,CH
SPACE1,*,1,CH
JOBNAME,*,8,CH
SPACE2,*,1,CH
GEN,*,5,CH
SPACE3,*,1,CH
SEQID,*,4,CH
SPACE4,*,1,CH
MM,*,2,CH
SLASH1,*,1,CH
DD,*,2,CH
SLASH2,*,1,CH
CRCEN,*,2,CH
YY,*,2,CH |
Data in synnames dataset:
| Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
JOB13245-R12 JOB12345 MMMMM NNNN 06/14/2006 |
I want to create a dataset with the a node containing MMDDYY from the above symname dataset (in this e.g. 061406).
The dataset name can be "A.B.DT061406". Please note that the third node is the date from symnames dataset.
Can the symnames symbol be used only in SORT CARDS??
Can you please guide me if there is any other means to achieve it?
TIA |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can build that dsname from the symbols, but what do you want to do with it? If you want to use it in a JCL statement, you would have to generate the JCL and send it to the internal reader.
For an example of how to do this kind of thing, see the "Generate JCL to submit to the internal reader" Smart DFSORT Trick at:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094 |
|
| Back to top |
|
 |
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
Frank
Thanks. I had the same idea - but was wondering if there are any other ways.
Thanks. I will try this approach. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
| Quote: |
| but was wondering if there are any other ways |
When JCL is created "on the fly" it is only data. To be a job, it must be presented to the system (i.e. Internal Reader). |
|
| Back to top |
|
 |
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
Hi
I tried generating the JCL but, the symbols from the SORTIN file was not replaced. I am sure am doing something stupid.
Can someone pls help me out on where I have gone wrong?
I am trying to substitute the date from the input file which i have defined using symnames to the third node of the dataset (DTMMDDYY)
| Code: |
//STEP2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
//SYMNAMES DD DSN=<symname dataset with symbol definitions>,DISP=SHR => def given @ top of this post
//SORTIN DD DSN=<symname dataset with data>,DISP=SHR => data given @ top of this post
//SORTOUT DD SYSOUT=(*,INTRDR)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
HEADER1=('//XXXXXXX$ JOB (nnnnnT,xxxxxxxx),CLASS=A,MSGCLASS=X,',/,
'// NOTIFY=&SYSUID',/,
'//STEP6 EXEC PGM=SARBCH',/,
'//SYSPRINT DD SYSOUT=*',/,
'//LISTOUT1 DD DSN=A.B.DTMMDDYY,',/,
'// DISP=(,CATLG,),UNIT=SYSALLDA,',/,
'// DCB=(LRECL=133,BLKSIZE=0,RECFM=FBA),',/,
'// SPACE=(CYL,(2,1),RLSE)',/,
'//SYSIN DD DSN=<control card for SARBCH>,DISP=SHR')
/* |
Thanks. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You seem to be kind of confused about which data set is what.
This is a record in an input data set (this is not a SYMNAMES data set):
| Code: |
JOB13245-R12 JOB12345 MMMMM NNNN 06/14/2006
|
This is a SYMNAMES data set that maps the input record:
| Code: |
REPORT-ID,*,12,CH
SPACE1,*,1,CH
JOBNAME,*,8,CH
SPACE2,*,1,CH
GEN,*,5,CH
SPACE3,*,1,CH
SEQID,*,4,CH
SPACE4,*,1,CH
MM,*,2,CH
SLASH1,*,1,CH
DD,*,2,CH
SLASH2,*,1,CH
CRCEN,*,2,CH
YY,*,2,CH
|
You can use the symbols in the SYMNAMES data set to select fields from the input record for use in the output records. You would just use the appropriate symbols where you need them. Here's the correct DFSORT job (I've corrected your LISTOUT1 line as indicated):
| Code: |
//STEP2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
//SYMNAMES DD DSN=<symname dataset with symbol definitions>,DISP=SHR
//SORTIN DD DSN=<input dataset with data>,DISP=SHR
//SORTOUT DD SYSOUT=(*,INTRDR)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
HEADER1=('//XXXXXXX$ JOB (nnnnnT,xxxxxxxx),CLASS=A,MSGCLASS=X,',/,
'// NOTIFY=&SYSUID',/,
'//STEP6 EXEC PGM=SARBCH',/,
'//SYSPRINT DD SYSOUT=*',/,
'//LISTOUT1 DD DSN=A.B.DT',MM,DD,YY,',',/, <-------
'// DISP=(,CATLG,),UNIT=SYSALLDA,',/,
'// DCB=(LRECL=133,BLKSIZE=0,RECFM=FBA),',/,
'// SPACE=(CYL,(2,1),RLSE)',/,
'//SYSIN DD DSN=<control card for SARBCH>,DISP=SHR')
/*
|
The following would be submitted to the internal reader:
| Code: |
//XXXXXXX$ JOB (NNNNNT,XXXXXXXX),CLASS=A,MSGCLASS=X,
// NOTIFY=&SYSUID
//STEP6 EXEC PGM=SARBCH
//SYSPRINT DD SYSOUT=*
//LISTOUT1 DD DSN=A.B.DT061406,
// DISP=(,CATLG,),UNIT=SYSALLDA,
// DCB=(LRECL=133,BLKSIZE=0,RECFM=FBA),
// SPACE=(CYL,(2,1),RLSE)
//SYSIN DD DSN=<CONTROL CARD FOR SARBCH>,DISP=SHR
|
|
|
| Back to top |
|
 |
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
Frank
I realized my stupidity. Thanks for the correction.
- Janusman |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|