I need to check a string in a GDG file, for example, to check 'ABCDEFG' in file : AAA.BBB.CCC.DDD(0).
IF YES, append this string 'ABCDEFG' to the bottom of a PDS member:
ABD.EFG.HIG(NAMES).
IF BOTH FILES ARE PSD FILES, there is no problem, while I changed to GDG and PDS member, it didn't work.
My Clist program can not allocate a gdg file, and also can not append to a member.It overided the member, when i allocated the file to SHR and OLD. MOD didn't work to a member file.
Can CLIST access PDS member and GDG file?
Moderators: Veera, Moderator Group
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
plenty of us do, but we also have had it with idiots that say my clist does not workDoes anybody have experience to deal with PDS member and GDG files?
and then don't bother to show us the clist.
If I have to guess, then so do you.
couple of points:
can't refer to gdg as AAA.BBB.CCC.DDD(0).
how are you going about 'apending' to the bottom of a pds member?
always allocate PDS member as SHR.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
when i use a flat file like 'AAA.BBB.CCC.NAMELOG' and 'ABC.DEF.GHI.NAMES' , it works ok, but when i chenge to GDG file and PDS member,errors happen. it can not find file abc.efg.names(0), and can not add to the member. If i change to SHR, it will clear the old records and write the new name to the member.
here is the code:
(this code extracted from a long program manually, may contain some other errors, but the most important thing i need help is how to read a GDG file and how to append records to a member file)
PROC 0 DSN1('AAA.BBB.CCC.NAMELOG')
ALLOCATE FILE(OFILE) DA('&DSN1') MOD
OPENFILE OFILE OUTPUT
SET EOF = OFF
SET RCODE = 0
SET CNAME = 'JOHN'
SET DNS2 = 'ABC.DEF.GHI.NAMES'
ALLOCATE FILE(NEXTNAME) DA(&DNS2) SHR
OPENFILE NEXTNAME INPUT
DO WHILE &EOF = OFF OR &RCODE ¬= 0
GETFILE NEXTNAME
IF &EOF=ON THEN DO
SET RCODE = 1
END
IF &STR(&SUBSTR(1:4,&NEXTNAME) = &CNAME THEN DO
CLOSFILE NEXTNAME
FREE F(NEXTNAME)
SET RCODE = 0
GOTO WRITELOG
END
END
WRITELOG: SET OFILE = &CNAME
PUTFILE OFILE
EXIT
here is the code:
(this code extracted from a long program manually, may contain some other errors, but the most important thing i need help is how to read a GDG file and how to append records to a member file)
PROC 0 DSN1('AAA.BBB.CCC.NAMELOG')
ALLOCATE FILE(OFILE) DA('&DSN1') MOD
OPENFILE OFILE OUTPUT
SET EOF = OFF
SET RCODE = 0
SET CNAME = 'JOHN'
SET DNS2 = 'ABC.DEF.GHI.NAMES'
ALLOCATE FILE(NEXTNAME) DA(&DNS2) SHR
OPENFILE NEXTNAME INPUT
DO WHILE &EOF = OFF OR &RCODE ¬= 0
GETFILE NEXTNAME
IF &EOF=ON THEN DO
SET RCODE = 1
END
IF &STR(&SUBSTR(1:4,&NEXTNAME) = &CNAME THEN DO
CLOSFILE NEXTNAME
FREE F(NEXTNAME)
SET RCODE = 0
GOTO WRITELOG
END
END
WRITELOG: SET OFILE = &CNAME
PUTFILE OFILE
EXIT
dbzTHEdinosauer wrote:plenty of us do, but we also have had it with idiots that say my clist does not workDoes anybody have experience to deal with PDS member and GDG files?
and then don't bother to show us the clist.
If I have to guess, then so do you.
couple of points:
can't refer to gdg as AAA.BBB.CCC.DDD(0).
how are you going about 'apending' to the bottom of a pds member?
always allocate PDS member as SHR.
I have no experience on CList, this is my first program. Could you please let me know how do you read a gdg file like AAA.BBB.CCC.DDD(0), and how do you add a record to a existing pds member like ABD.EFG.HIG(NAMES)? Thanks!
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
1. use rexx, not clist. clist is a good (albeit very old) language for sys-programmers,
but for data manipulation, REXX is better.
2. look for OUTTRAP and LISTDSI. this will list the gdg names with GnnnVnn, which is the syntax that you have to use.
3. to 'append' lines to a pds member, either
but for data manipulation, REXX is better.
2. look for OUTTRAP and LISTDSI. this will list the gdg names with GnnnVnn, which is the syntax that you have to use.
3. to 'append' lines to a pds member, either
- invoke an EDIT session with an IMACRO which can INSERT_AFTER your line
- use EXECIO to read the member into a stem, then add your line to the stem, then use EXECIO to write the member
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
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