¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: COBOL getting system time and/or date

 

Hi:

On my work I saw several "old" cobol programs for which there's a SYSIN card with DD DSN=SOME.FILE

Then that DSN contains current date, and COBOL performs ACCEPT FROM SYSIN.?

Maybe this was done because of there was no DATE then??


COBOL getting system time and/or date

 

Hi guys.

I'm missing something again regarding our beloved MVT COBOL F compiler.. this time, I'm trying to get the system date and or time, but I'm missing miserably.
I've looked for the right syntax in my collection of vintage bitsavers cobol books but I do not find anythin in the 64' and 68/ OS/360 books I have.
As always, the 72' OS VS COBOL book seems the most plausible? to me... but i barely mentions the matter on page 401 for ACCEPT.

So, I'm trying this:

ACCEPT CD-CURRENT-DATE FROM DATE.

To which the compiler complains:
?
IKF3001I-E DATE NOT DEFINED. SYSTEM UNIT ASUMED.?

So I guess I maybe missing something on the JCL, or something on the syntax is different... does anyone knows how to get data and or time?

Thanks.
Cheers.
Alejandro.


Re: VSAM cluster allocation error

 

Try adding UNIQUE to the cluster definition.? Also, move the space allocations to the data and index components. ? like this:

DEFINE CLUSTER??????????????????????????????????? -????????????????????????? ?
???????? (NAME(HERC02.VSAM.EXAMPLE1) INDEXED??????? -????????????????????????? ?
???????? VOLUMES(VSAM01)??????????????????????????? -????????????????????????? ?
???????? RECORDSIZE(80 80)????????????????????????? -????????????????????????? ?
???????? KEYS(10 0)???????????????????????????????? -????????????????????????? ?
???????? FREESPACE(5 5)???????????????????????????? -????????????????????????? ?
???????? CISZ(4096)???????????????????????????????? -????????????????????????? ?
???????? REUSE?? -
UNIQUE ????????????????????????????????? -????????????????????????? ?
???????? )????????????????????????????????????????? -????????????????????????? ?
???????? DATA (NAME (HERC02.VSAM.EXAMPLE1.DATA) -
???????? TRACKS(1 1))??? -????????????????????????? ?
??????? INDEX (NAME (HERC02.VSAM.EXAMPLE1.INDEX)
???????? TRACKS(50 15))

Since you don't have a VSAM dataspace, you must use the UNIQUE option.? Index components are much smaller than data components and require less space.


Re: VSAM cluster allocation error

 

Delete is fine.
MVS 3.8 uses CVOL and VSAM catalogs.
You may not have the needed catalog defined.
UNIQUE is required to get space outside a dataspace.


On Thu, Mar 21, 2024 at 3:24?PM rcigola via groups.io
<rcigola@...> wrote:

Hi guys, I am trying to allocate a VSAM file, this is the jcl :

//HERC02CP JOB (IDCAMS),'PERFORM IDCAMS ',CLASS=A,NOTIFY=&SYSUID,
// REGION=8000K,TIME=1440,MSGCLASS=X,MSGLEVEL=(1,1)
//
//* CREATE VSAM DATASET
//*
//
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
DELETE HERC02.VSAM.EXAMPLE1
SET MAXCC = 0
DEFINE CLUSTER -
(NAME(HERC02.VSAM.EXAMPLE1) INDEXED -
VOLUMES(VSAM01) -
RECORDSIZE(80 80) -
KEYS(10 0) -
TRACKS(50 15) -
FREESPACE(5 5) -
CISZ(4096) -
REUSE -
) -
DATA (NAME (HERC02.VSAM.EXAMPLE1.DATA)) -
INDEX (NAME (HERC02.VSAM.EXAMPLE1.INDEX))
/*

but I get this error when I try to allocate a VSAM :

IDCAMS SYSTEM SERVICES TIME: 15:45:21

DELETE HERC02.VSAM.EXAMPLE1
IDC3012I ENTRY HERC02.VSAM.EXAMPLE1 NOT FOUND
IDC3009I ** VSAM CATALOG RETURN CODE IS 8 - REASON CODE IS IGG0CLAG-6
IDC0551I **ENTRY HERC02.VSAM.EXAMPLE1 NOT DELETED
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 8

SET MAXCC = 0

DEFINE CLUSTER -
(NAME(HERC02.VSAM.EXAMPLE1) INDEXED -
VOLUMES(VSAM01) -
RECORDSIZE(80 80) -
KEYS(10 0) -
TRACKS(50 15) -
FREESPACE(5 5) -
CISZ(4096) -
REUSE -
) -
DATA (NAME (HERC02.VSAM.EXAMPLE1.DATA)) -
INDEX (NAME (HERC02.VSAM.EXAMPLE1.INDEX))
IDC3033I VOLUME RECORD NOT FOUND IN CATALOG
IDC3009I ** VSAM CATALOG RETURN CODE IS 248 - REASON CODE IS IGG0CLBX-0
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12

the VSAM01 is a 3380-E disk created with :
dasdinit -a vsam01.382 3380-E VSAM01 then I initialized with this job :

//HERC02CP JOB (ICKDSF),'PERFORM ICKDSF13',CLASS=A,NOTIFY=&SYSUID,
// REGION=8000K,TIME=1440,MSGCLASS=X,MSGLEVEL=(1,1)
//*
//* INITIALIZE A DEVICE OTHER THAN 3340 OR 3350 DASD VOLUME
//*
//ICKDSF EXEC PGM=ICKDSF13,REGION=6096K
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
INIT UNITADDRESS(382) NOVERIFY VOLID(VSAM01) OWNER(HERCULES) -
VTOC(0,1,80)
/*
//

and I see the volume on 3.4 and I allocated a PD dataset without effort.
does anyone have any clue why I am getting this error ?
Thanks


--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?


Re: VSAM cluster allocation error

 

No, even if you remove the delete statement you will still get an error!
Without am user catalog and data space defined on the new volume you will go nowhere

Marco


Re: VSAM cluster allocation error

 

Comment out or remove the Delete statement and rerun.? It is giving an error because the file does not exist.


regards;

Rahim



??



On Thursday, March 21, 2024 at 03:24:16 PM CDT, rcigola via groups.io <rcigola@...> wrote:


Hi guys, I am trying to allocate a VSAM file, this is the jcl :

//HERC02CP JOB (IDCAMS),'PERFORM IDCAMS? ',CLASS=A,NOTIFY=&SYSUID,???? ?
//???????????? REGION=8000K,TIME=1440,MSGCLASS=X,MSGLEVEL=(1,1)??????? ?
//
//*????????????????? CREATE VSAM DATASET?????????????????????????????? ?
//*??????????????????????????????????????????????????????????????????? ?
//
//STEP1 EXEC PGM=IDCAMS??????????????????????????????????????????????? ?
//SYSPRINT DD SYSOUT=*???????????????????????????????????????????????? ?
//SYSOUT?? DD SYSOUT=*???????????????????????????????????????????????? ?
//SYSUDUMP DD SYSOUT=*???????????????????????????????????????????????? ?
//SYSIN??? DD *??????????????????????????????????????????????????????? ?
? DELETE HERC02.VSAM.EXAMPLE1????????????????????????????????????????? ?
? SET MAXCC = 0??????????????????????????????????????????????????????? ?
? DEFINE CLUSTER??????????????????????????????????? -????????????????? ?
???????? (NAME(HERC02.VSAM.EXAMPLE1) INDEXED??????? -????????????????? ?
???????? VOLUMES(VSAM01)??????????????????????????? -????????????????? ?
???????? RECORDSIZE(80 80)????????????????????????? -????????????????? ?
???????? KEYS(10 0)???????????????????????????????? -????????????????? ?
???????? TRACKS(50 15)????????????????????????????? -????????????????? ?
???????? FREESPACE(5 5)???????????????????????????? -????????????????? ?
???????? CISZ(4096)???????????????????????????????? -????????????????? ?
???????? REUSE????????????????????????????????????? -????????????????? ?
???????? )????????????????????????????????????????? -????????????????? ?
???????? DATA (NAME (HERC02.VSAM.EXAMPLE1.DATA))??? -????????????????? ?
??????? INDEX (NAME (HERC02.VSAM.EXAMPLE1.INDEX))????????????????????? ?
/*???????????????????????????????????????????????????????????????????? ?

but I get this error when I try to allocate a VSAM :

IDCAMS? SYSTEM SERVICES?????????????????????????????????????????? TIME: 15:45:21
?????????????????????????????????????????????????????????????????????????????? ?
? DELETE HERC02.VSAM.EXAMPLE1????????????????????????????????????????????????? ?
IDC3012I ENTRY HERC02.VSAM.EXAMPLE1 NOT FOUND????????????????????????????????? ?
IDC3009I ** VSAM CATALOG RETURN CODE IS 8 - REASON CODE IS IGG0CLAG-6????????? ?
IDC0551I **ENTRY HERC02.VSAM.EXAMPLE1 NOT DELETED????????????????????????????? ?
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 8????????????????????? ?
?????????????????????????????????????????????????????????????????????????????? ?
? SET MAXCC = 0??????????????????????????????????????????????????????????????? ?
?????????????????????????????????????????????????????????????????????????????? ?
? DEFINE CLUSTER??????????????????????????????????? -????????????????????????? ?
???????? (NAME(HERC02.VSAM.EXAMPLE1) INDEXED??????? -????????????????????????? ?
???????? VOLUMES(VSAM01)??????????????????????????? -????????????????????????? ?
???????? RECORDSIZE(80 80)????????????????????????? -????????????????????????? ?
???????? KEYS(10 0)???????????????????????????????? -????????????????????????? ?
???????? TRACKS(50 15)????????????????????????????? -????????????????????????? ?
???????? FREESPACE(5 5)???????????????????????????? -????????????????????????? ?
???????? CISZ(4096)???????????????????????????????? -????????????????????????? ?
???????? REUSE????????????????????????????????????? -????????????????????????? ?
???????? )????????????????????????????????????????? -????????????????????????? ?
???????? DATA (NAME (HERC02.VSAM.EXAMPLE1.DATA))??? -????????????????????????? ?
??????? INDEX (NAME (HERC02.VSAM.EXAMPLE1.INDEX))????????????????????????????? ?
IDC3033I VOLUME RECORD NOT FOUND IN CATALOG??????????????????????????????????? ?
IDC3009I ** VSAM CATALOG RETURN CODE IS 248 - REASON CODE IS IGG0CLBX-0??????? ?
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12???????????????????????????? ?
?????????????????????????????????????????????????????????????????????????????? ?
the VSAM01 is a 3380-E disk created with :
dasdinit -a vsam01.382 3380-E VSAM01 then I initialized with this job? :

//HERC02CP JOB (ICKDSF),'PERFORM ICKDSF13',CLASS=A,NOTIFY=&SYSUID,??? ?
//???????????? REGION=8000K,TIME=1440,MSGCLASS=X,MSGLEVEL=(1,1)?????? ?
//*?????????????????????????????????????????????????????????????????? ?
//*?? INITIALIZE A DEVICE OTHER THAN 3340 OR 3350 DASD VOLUME???????? ?
//*?????????????????????????????????????????????????????????????????? ?
//ICKDSF?? EXEC PGM=ICKDSF13,REGION=6096K???????????????????????????? ?
//SYSPRINT DD? SYSOUT=*?????????????????????????????????????????????? ?
//SYSIN??? DD? *????????????????????????????????????????????????????? ?
? INIT UNITADDRESS(382) NOVERIFY VOLID(VSAM01) OWNER(HERCULES) -????? ?
?????????????? VTOC(0,1,80)?????????????????????????????????????????? ?
/*??????????????????????????????????????????????????????????????????? ?
//???????????????????????????????????????????????????????????????????? ?

and I see the volume on 3.4 and I allocated a PD dataset without effort.
does anyone have any clue why I am getting this error ?
Thanks


VSAM cluster allocation error

 

Hi guys, I am trying to allocate a VSAM file, this is the jcl :

//HERC02CP JOB (IDCAMS),'PERFORM IDCAMS? ',CLASS=A,NOTIFY=&SYSUID,???? ?
//???????????? REGION=8000K,TIME=1440,MSGCLASS=X,MSGLEVEL=(1,1)??????? ?
//
//*????????????????? CREATE VSAM DATASET?????????????????????????????? ?
//*??????????????????????????????????????????????????????????????????? ?
//
//STEP1 EXEC PGM=IDCAMS??????????????????????????????????????????????? ?
//SYSPRINT DD SYSOUT=*???????????????????????????????????????????????? ?
//SYSOUT?? DD SYSOUT=*???????????????????????????????????????????????? ?
//SYSUDUMP DD SYSOUT=*???????????????????????????????????????????????? ?
//SYSIN??? DD *??????????????????????????????????????????????????????? ?
? DELETE HERC02.VSAM.EXAMPLE1????????????????????????????????????????? ?
? SET MAXCC = 0??????????????????????????????????????????????????????? ?
? DEFINE CLUSTER??????????????????????????????????? -????????????????? ?
???????? (NAME(HERC02.VSAM.EXAMPLE1) INDEXED??????? -????????????????? ?
???????? VOLUMES(VSAM01)??????????????????????????? -????????????????? ?
???????? RECORDSIZE(80 80)????????????????????????? -????????????????? ?
???????? KEYS(10 0)???????????????????????????????? -????????????????? ?
???????? TRACKS(50 15)????????????????????????????? -????????????????? ?
???????? FREESPACE(5 5)???????????????????????????? -????????????????? ?
???????? CISZ(4096)???????????????????????????????? -????????????????? ?
???????? REUSE????????????????????????????????????? -????????????????? ?
???????? )????????????????????????????????????????? -????????????????? ?
???????? DATA (NAME (HERC02.VSAM.EXAMPLE1.DATA))??? -????????????????? ?
??????? INDEX (NAME (HERC02.VSAM.EXAMPLE1.INDEX))????????????????????? ?
/*???????????????????????????????????????????????????????????????????? ?

but I get this error when I try to allocate a VSAM :

IDCAMS? SYSTEM SERVICES?????????????????????????????????????????? TIME: 15:45:21
?????????????????????????????????????????????????????????????????????????????? ?
? DELETE HERC02.VSAM.EXAMPLE1????????????????????????????????????????????????? ?
IDC3012I ENTRY HERC02.VSAM.EXAMPLE1 NOT FOUND????????????????????????????????? ?
IDC3009I ** VSAM CATALOG RETURN CODE IS 8 - REASON CODE IS IGG0CLAG-6????????? ?
IDC0551I **ENTRY HERC02.VSAM.EXAMPLE1 NOT DELETED????????????????????????????? ?
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 8????????????????????? ?
?????????????????????????????????????????????????????????????????????????????? ?
? SET MAXCC = 0??????????????????????????????????????????????????????????????? ?
?????????????????????????????????????????????????????????????????????????????? ?
? DEFINE CLUSTER??????????????????????????????????? -????????????????????????? ?
???????? (NAME(HERC02.VSAM.EXAMPLE1) INDEXED??????? -????????????????????????? ?
???????? VOLUMES(VSAM01)??????????????????????????? -????????????????????????? ?
???????? RECORDSIZE(80 80)????????????????????????? -????????????????????????? ?
???????? KEYS(10 0)???????????????????????????????? -????????????????????????? ?
???????? TRACKS(50 15)????????????????????????????? -????????????????????????? ?
???????? FREESPACE(5 5)???????????????????????????? -????????????????????????? ?
???????? CISZ(4096)???????????????????????????????? -????????????????????????? ?
???????? REUSE????????????????????????????????????? -????????????????????????? ?
???????? )????????????????????????????????????????? -????????????????????????? ?
???????? DATA (NAME (HERC02.VSAM.EXAMPLE1.DATA))??? -????????????????????????? ?
??????? INDEX (NAME (HERC02.VSAM.EXAMPLE1.INDEX))????????????????????????????? ?
IDC3033I VOLUME RECORD NOT FOUND IN CATALOG??????????????????????????????????? ?
IDC3009I ** VSAM CATALOG RETURN CODE IS 248 - REASON CODE IS IGG0CLBX-0??????? ?
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12???????????????????????????? ?
?????????????????????????????????????????????????????????????????????????????? ?
the VSAM01 is a 3380-E disk created with :
dasdinit -a vsam01.382 3380-E VSAM01 then I initialized with this job? :

//HERC02CP JOB (ICKDSF),'PERFORM ICKDSF13',CLASS=A,NOTIFY=&SYSUID,??? ?
//???????????? REGION=8000K,TIME=1440,MSGCLASS=X,MSGLEVEL=(1,1)?????? ?
//*?????????????????????????????????????????????????????????????????? ?
//*?? INITIALIZE A DEVICE OTHER THAN 3340 OR 3350 DASD VOLUME???????? ?
//*?????????????????????????????????????????????????????????????????? ?
//ICKDSF?? EXEC PGM=ICKDSF13,REGION=6096K???????????????????????????? ?
//SYSPRINT DD? SYSOUT=*?????????????????????????????????????????????? ?
//SYSIN??? DD? *????????????????????????????????????????????????????? ?
? INIT UNITADDRESS(382) NOVERIFY VOLID(VSAM01) OWNER(HERCULES) -????? ?
?????????????? VTOC(0,1,80)?????????????????????????????????????????? ?
/*??????????????????????????????????????????????????????????????????? ?
//???????????????????????????????????????????????????????????????????? ?

and I see the volume on 3.4 and I allocated a PD dataset without effort.
does anyone have any clue why I am getting this error ?
Thanks


Re: COBOL help opening datasets to append records.

 

¿ªÔÆÌåÓý

Alejandro,

While not EXACTLY appropriate for your situation ¨C

I am glad to see you solved your issue and got the output you were looking for.

?

Please understand the DISPOSITION parm in JCL ¨C ?

?

NEW ¨C open an create a new file

OLD ¨C open an existing file ¨C (exclusive control)

SHR ¨C open an existing file with SHARE control

MOD ¨C open an existing file and ADD TO THE END OF THE FILE ¨C

?

?

-J-

?

Jeff Bassett

Bassettj@...

(301) 424-3362 (office)

(240) 388-7148 Cell

?

Time spent flying? - is NOT deducted from one¡¯s lifespan

?

From: [email protected] <[email protected]> On Behalf Of Alejandro olivan Alvarez via groups.io
Sent: Thursday, March 21, 2024 9:25 AM
To: [email protected]
Subject: Re: [H390-MVS] COBOL help opening datasets to append records.

?

Surprisingly, once I realized that I could simply let the destination file opened (from the execution of sort input procedure) and close it at the end of the sort output procedure, the program did what I wanted with a very nice looking set of code (early 70s style coding :-D)
It is fun to see that, as you say, cobol is simply spawning the SORT program on its own to perform the work, as the SORT program output gets printed as part of the job output.

Initially, I did the exercice with raw JCL / SORT invocation... but I required several steps, separating the headr records from the payload records into different temporary datasets, sort the payload dataset and, finally, merge them into a final one... and all that, without getting rid of duplicates (which was my initial motivation to switch to use SORT under COBOL, since MVT COBOL does not support the SUM stuff)
After reading the COBOL book from 72 about SORT (which was veeery brief, pheww, just a single example!), I learn that the in out procedures were in fact, meant, to do things similar to what I wanted to do.

The idea of tagging the header records is very clever!
The way I solved that is simply counting iterations, since I know how many records my headers consist on... however, it is an interesting ideo to handle 'variable size' headers in a future!

Regarding the software/companies you mention...well... I do not know anything about anything :-P

Cheers.
Alejandro.


Re: COBOL help opening datasets to append records.

 

Surprisingly, once I realized that I could simply let the destination file opened (from the execution of sort input procedure) and close it at the end of the sort output procedure, the program did what I wanted with a very nice looking set of code (early 70s style coding :-D)
It is fun to see that, as you say, cobol is simply spawning the SORT program on its own to perform the work, as the SORT program output gets printed as part of the job output.

Initially, I did the exercice with raw JCL / SORT invocation... but I required several steps, separating the headr records from the payload records into different temporary datasets, sort the payload dataset and, finally, merge them into a final one... and all that, without getting rid of duplicates (which was my initial motivation to switch to use SORT under COBOL, since MVT COBOL does not support the SUM stuff)
After reading the COBOL book from 72 about SORT (which was veeery brief, pheww, just a single example!), I learn that the in out procedures were in fact, meant, to do things similar to what I wanted to do.

The idea of tagging the header records is very clever!
The way I solved that is simply counting iterations, since I know how many records my headers consist on... however, it is an interesting ideo to handle 'variable size' headers in a future!

Regarding the software/companies you mention...well... I do not know anything about anything :-P

Cheers.
Alejandro.


Re: COBOL help opening datasets to append records.

 

Dear Alejandro,

If I recall correctly, COBOL programs with SORT inside are in fact a SORT main program with COBOL routines inside that do not read or write directly to the input or output files, and maybe when you open an input or output file in the COBOL input side, you are in fact reopen it.

Using COBOL with SORT is a bit tricky and difficult to maintain, specially when configuring JCL steps on advanced job schedulers. This is the reason why it is forbidden in all the big mainframes sites I have worked in Germany, France, Brasil and Spain (mainly big banks).?

In your case, the need to preserve the header records make still more difficult to solve your problem in a single program and jcl step.

Any JCL step and COBOL+SORT program is easier to replace and maintain with three JCL steps of two COBOL programs (input and output treatment), and an external SORT in an step in the middle, but we are using Hercules for fun and learning purposes, as myself currently interested in old FORTRAN IV libraries from the CBT.

Did you tried to add an additional field in the filler trailing bytes with a flag for "header record" as H01, H02,...?
You could SORT with this field as first field in the sort key specification and you wouldn't need to add special header write instructions.

Did you know EASYTRIEVE from Pansophic and later as Computer Associates??
It is very interesting how to write equivalent programs with Easytrieve.

Alejandro Garcia?
Barcelona


On dj., de mar? 21, 2024 at 11:12, Alejandro olivan Alvarez
<alejandro.olivan.alvarez@...> wrote:
Thank you all guys for the points.

The thing is that, the code I was playing with, uses SORT together with its input and output procedures (nice feature!).
The goal was to let an input dataset full of records, including a set of header records, be sorted, with duplicated records suppressed, and write them to a member, all in one go if possible.
The strategy was to use the input procedure to bypass the header redcords from sort, and write them directly to output, and in the output procedure, simply check for duplicate records
before writing to file.

So, in my sort in procedure, I opened the output file, and write the header records directly, bypassing them being fed to sort, and, politely, close the file.
Then, on the output procedure from sort, I opened again the file, checked every passing, sorted, record, and write them to output file only if they're different from the last one. And, again, close the file.
Ideally, I would have been able to open in extend mode in the sort output procedure... but there I came with the issue that that's not possible.

Playing with the SHR in the JCL, gave interesting results:
If opening in SHR mode, the second OPENing makes existeing header records to be replaced. No surprise.
But If opening in OLD mode, while the header files are kept, as expected... only a few records are written afterwards, like if the job/step ended prematurely or something weird.

What I'm doing now is to open the output file on the sort input procedure, and let it open (which doesn't look polite in my eyes), then, let the sort output procedure close it.
Since there's only a single opening, it seems I can do all the output file writes in one go in SHR mode.

Cheers.
Alejandro
?


Re: COBOL help opening datasets to append records.

 

Hi Alejandro,

Don't close the file, continue to write in
I found your logic just complicated

¸é±ð²Ô¨¦


Le jeudi 21 mars 2024 ¨¤ 11:12:56 UTC+1, Alejandro olivan Alvarez <alejandro.olivan.alvarez@...> a ¨¦crit :


Thank you all guys for the points.

The thing is that, the code I was playing with, uses SORT together with its input and output procedures (nice feature!).
The goal was to let an input dataset full of records, including a set of header records, be sorted, with duplicated records suppressed, and write them to a member, all in one go if possible.
The strategy was to use the input procedure to bypass the header redcords from sort, and write them directly to output, and in the output procedure, simply check for duplicate records
before writing to file.

So, in my sort in procedure, I opened the output file, and write the header records directly, bypassing them being fed to sort, and, politely, close the file.
Then, on the output procedure from sort, I opened again the file, checked every passing, sorted, record, and write them to output file only if they're different from the last one. And, again, close the file.
Ideally, I would have been able to open in extend mode in the sort output procedure... but there I came with the issue that that's not possible.

Playing with the SHR in the JCL, gave interesting results:
If opening in SHR mode, the second OPENing makes existeing header records to be replaced. No surprise.
But If opening in OLD mode, while the header files are kept, as expected... only a few records are written afterwards, like if the job/step ended prematurely or something weird.

What I'm doing now is to open the output file on the sort input procedure, and let it open (which doesn't look polite in my eyes), then, let the sort output procedure close it.
Since there's only a single opening, it seems I can do all the output file writes in one go in SHR mode.

Cheers.
Alejandro
?


Re: COBOL help opening datasets to append records.

 

Thank you all guys for the points.

The thing is that, the code I was playing with, uses SORT together with its input and output procedures (nice feature!).
The goal was to let an input dataset full of records, including a set of header records, be sorted, with duplicated records suppressed, and write them to a member, all in one go if possible.
The strategy was to use the input procedure to bypass the header redcords from sort, and write them directly to output, and in the output procedure, simply check for duplicate records
before writing to file.

So, in my sort in procedure, I opened the output file, and write the header records directly, bypassing them being fed to sort, and, politely, close the file.
Then, on the output procedure from sort, I opened again the file, checked every passing, sorted, record, and write them to output file only if they're different from the last one. And, again, close the file.
Ideally, I would have been able to open in extend mode in the sort output procedure... but there I came with the issue that that's not possible.

Playing with the SHR in the JCL, gave interesting results:
If opening in SHR mode, the second OPENing makes existeing header records to be replaced. No surprise.
But If opening in OLD mode, while the header files are kept, as expected... only a few records are written afterwards, like if the job/step ended prematurely or something weird.

What I'm doing now is to open the output file on the sort input procedure, and let it open (which doesn't look polite in my eyes), then, let the sort output procedure close it.
Since there's only a single opening, it seems I can do all the output file writes in one go in SHR mode.

Cheers.
Alejandro
?


Re: COBOL help opening datasets to append records.

 

¿ªÔÆÌåÓý

No - there is no EXTEND mode - too early.

Can I suggest that you use ISAM mode instead for this file if needed create a simple key if there is no field that you can use say starting with 1.

Then OPEN I-O, then all WRITE statements for a new record will work with the added benefit if also using REWRITE if you need to update an existing record.

See the documentation from Jay regarding the use of ISAM type files with Cobol for how to do it.

Vince


On 15/03/2024 13:30, Alejandro olivan Alvarez wrote:

Hi folks.

So I'm trying to append records to an existing dataset with COBOL... wich should be quite straight forward: OPEN EXTEND MY-FILE

But it seems the compiler does not support that opening mode.
I took a look at the 1972 IBM book I use as a reference for the included compiler and, at OPEN clause, section (very brief one... so maybe not a comprehensive guide with not all options covered), I see that it only mentions INPUT and OUTPUT, no EXTEND whatsoever.
So while I believe that it is indeed possible, the thing is that there must be for sure a way to perform such a fundamental operation, even with this compiler.

As anyone a clue? Am I missing something?

Thanks you.
Cheers.
Alex.??
_._,_._,_


Re: COBOL help opening datasets to append records.

 

Alex,

John has already answered your question. I have a Feingold text from that era that clearly states EXTEND is valid for OPEN, but obviously this compiler has not read the Feingold text. I have attached the output of a job showing creating and then extending a simple sequential dataset on disk.


Re: COBOL help opening datasets to append records.

 

¿ªÔÆÌåÓý

Alejandro:

Try this. To add new records to the end of a file that already exists, you must:

  1. Open the file OUTPUT,
  2. Then in your JCL, the DD statement for the file needs to have a DISP=MOD

Now, new records will be added to the end of the file.

The old COBOL did not give you a way to express your intent entirely within the program. You have to do a dance between the COBOL and the JCL.

John Holland

Quoting Alejandro olivan Alvarez <alejandro.olivan.alvarez@...>:

Hi folks.

So I'm trying to append records to an existing dataset with COBOL... wich should be quite straight forward: OPEN EXTEND MY-FILE

But it seems the compiler does not support that opening mode.
I took a look at the 1972 IBM book I use as a reference for the included compiler and, at OPEN clause, section (very brief one... so maybe not a comprehensive guide with not all options covered), I see that it only mentions INPUT and OUTPUT, no EXTEND whatsoever.
So while I believe that it is indeed possible, the thing is that there must be for sure a way to perform such a fundamental operation, even with this compiler.

As anyone a clue? Am I missing something?

Thanks you.
Cheers.
Alex.??




COBOL help opening datasets to append records.

 

Hi folks.

So I'm trying to append records to an existing dataset with COBOL... wich should be quite straight forward: OPEN EXTEND MY-FILE

But it seems the compiler does not support that opening mode.
I took a look at the 1972 IBM book I use as a reference for the included compiler and, at OPEN clause, section (very brief one... so maybe not a comprehensive guide with not all options covered), I see that it only mentions INPUT and OUTPUT, no EXTEND whatsoever.
So while I believe that it is indeed possible, the thing is that there must be for sure a way to perform such a fundamental operation, even with this compiler.

As anyone a clue? Am I missing something?

Thanks you.
Cheers.
Alex.??


Re: GETDTE - MVS 3.8j TK4

 

Hi Dagfinn,

In TK4, ZP60038 is probably not applied.

Please consider to migrate to MVS-TK5.


Here is the user's guide with the migration steps.


Cheers,
Rob


GETDTE - MVS 3.8j TK4

 

Hi
I am trying to implement GETDTE on my TK4 UPD 8 system. I get an error in JOB4 in the installation process. I suspect this is related to missing usermods. Where are the usermod library located?

*? Prerequisite: User Modifications? ? ? ? ? ? ? ?
*? ===================================================================
*
*? ? ?Two user-mods, ZP60014 and ZP60038, are REQUIRED to process
*? CLIST symbolic variables via the IKJCT441 API on MVS 3.8J before
*? using GETDTE.? Otherwise, GETDTE will function but will NOT? ? ?
*? create CLIST variables.
*
*? ? ?More information on the above user-mods can be obtained from
*? the following website:
*? ? ? ?http://www.prycroft6.com.au/vs2mods/
*
*? ? ?Check your system to determine if one or both user-mods are
*? required.? ZP60038 requires ZP60014.

best regards
Dagfinn D. Hammar
GETDTE ¨C System DSECTs
LOC OBJECT CODE ADDR1 ADDR2 STMT SOURCE STATEMENT
000000 3125 TIOT DSECT
3126 IEFTIOT1 Task
*** ERROR ***
00000 3127 TIOTLEN EQU *-TIOT Lengt
GETDTE ¨C System DSECTs
LOC OBJECT CODE ADDR1 ADDR2 STMT SOURCE STATEMENT
000000 3129 JSCB DSECT
3130 IEZJSCB Job/S
GETDTE ¨C System DSECTs
LOC OBJECT CODE ADDR1 ADDR2 STMT SOURCE STATEMENT


Re: HELP! How to return to MVS Console

 

Hello Fish,

Am 26.02.2024 um 19:25 schrieb Fish Fish <david.b.trout@...>:

Just for the record, for years I'm ending OS/390 by just issuing a quit to the Hercules console to make it close the disk files properly.
So you DO care about Hercules closing its disks properly but DON'T care about your OS/390 guest closing its disks properly?
Yes, because I've not seen any adverse effects.

In contrast, sending a SIGTERM to Hercules does leave the disk files in a state where they need repair.

You're a strange person, Patrik. :)
Thanks for the compliment I hereby return. ;-)

Of course I do this while the system is idle from user-submitted jobs.
But to hell with any system processes who's disk buffers might not have been flushed yet? You don't care about those? They're not important, right?
See my original comment. No adverse effects seen, do only on a quiet system.

For *me* it works. Your mileage may vary.

Too lazy to manually wade through the shutdown sequence,
or trying to automate it as did TK4-.
Of course! No one wants to mess with any stinking automation after all. Just pull the plug!
Do I smell some personal offense of yours?

Had not noticed any adverse effects.
Well, each guest is different I guess. OS/390 must obviously behave quite a bit differently than other guest operating systems.
Apparently.

Your mileage may vary.
Indeed. If it works for you? Fine.
Exactly.

But I personally would *never* publicly recommend such an irresponsible highly risky procedure to others.
As I said, it works for me without visible or even adverse effects.

But then as I guess you say, your mileage may vary. Right? >;-)
Correct.

p.s. I'm curious: do you power off you Linux host operating system the same way? Just pull the plug?
No. Because at next boot, I'll get journal recovery notes.

I'm not aware of any WTO messages regarding my habit on OS/390.

:wq! PoC


Re: HELP! How to return to MVS Console

 

Hello Chris,

Am 26.02.2024 um 11:15 schrieb cjar1950 via groups.io <cjar1950@...>:

Are you still talking Z/OS, or OS/390?
OS/390.

:wq! PoC