I have to read the date from the ps file or any member of pds file which has the date in the following format yyyymmdd.
how can I use this date in place of current date as symbolic in the jcl.
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
INCLUDE=(INC1,EQ,C'B',AND,(BLD4,BI,EQ,BLD3,BI)),
BUILD=(RFFLD),
TRAILER1=(DATE,COUNT=(M10,LENGTH=8))
ALL suggesstions are obviously welcome. I probably would want to stay with JCL
How to pass system date stored in a PDS member to symbolic ?
Moderators: Frank Yaeger, Moderator Group
Read the file and write the sort control statements into a file for subsequent use in the sort step. The sort control statements will no longer be inline.
I know of no way to get data from a dataset into some control statement via a "symbolic" (which is a jcl function, not a data file function).
I know of no way to get data from a dataset into some control statement via a "symbolic" (which is a jcl function, not a data file function).
Have a good one
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Chanakya,
You can use a DFSORT job something like this. S1 creates symbol MYDATE in file &&S1. S2 concatenates &&S1 to your SYMNAMES data set so MYDATE can be used.
You can use a DFSORT job something like this. S1 creates symbol MYDATE in file &&S1. S2 concatenates &&S1 to your SYMNAMES data set so MYDATE can be used.
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... file or member with yyyymmdd in positions 1-8
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'MYDATE,''',1,8,C'''',80:X)
/*
//S2 EXEC PGM=SORT
//SYMNAMES DD DSN=... symbol data set
// DD DSN=&&S1,DISP=(OLD,PASS)
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT DD DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
INCLUDE=(INC1,EQ,C'B',AND,(BLD4,BI,EQ,BLD3,BI)),
BUILD=(RFFLD),
TRAILER1=(MYDATE,COUNT=(M10,LENGTH=5))
/*
Last edited by Frank Yaeger on Fri Oct 07, 2011 10:11 pm, edited 1 time in total.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Hi Frank,
Thank you very much!! It is working as expected.
Could you please help me to understand below code's working?
Can you explain how it is working?
Especially (,''',) and (C'''',80:X)
Thank you very much!! It is working as expected.
Could you please help me to understand below code's working?
Frank Yaeger wrote:Chanakya,
Code: Select all
INREC BUILD=(C'MYDATE,''',1,8,C'''',80:X)
Can you explain how it is working?
Especially (,''',) and (C'''',80:X)
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
When you want to use an apostrophe within 'string', you have to code two apostrophes.
C'MYDATE,''',1,8,C'''',80:X
Breaking it down, you get:
MYDATE,'string',80:X
MYDATE is the symbol name.
'string' is the date constant.
80:X tells DFSORT to put blanks up to column 80 (easy way to set the record length to 80).
So for example, if you have 20110518 in positions 1,8, INREC will build the following 80-byte symbol statement:
MYDATE,'20110518'
You can then use MYDATE in SYMNAMES as a symbol for '20110518'.
C'MYDATE,''',1,8,C'''',80:X
Breaking it down, you get:
MYDATE,'string',80:X
MYDATE is the symbol name.
'string' is the date constant.
80:X tells DFSORT to put blanks up to column 80 (easy way to set the record length to 80).
So for example, if you have 20110518 in positions 1,8, INREC will build the following 80-byte symbol statement:
MYDATE,'20110518'
You can then use MYDATE in SYMNAMES as a symbol for '20110518'.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page