Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Wed Mar 03, 2010 4:52 pm Post subject:
mf_user,
You are creating a new generation in the program and the catalog isn't updated with the information until you close the dataset or the step running this program ends.
You can read the listcat info and manually increment the generation number but you can never guarantee that it would be right generation number.
you can add 2 steps after the program and read the list cat and append the generation name to it.
What are your choices? 1. You want to update the program,PROGP320, "to pick 123"? 2. or you can afford another job to update the latest generation (output)?
If you go with option one, you need to make sure that no other job is working with this GDG at that moment and then what Kolusu has said can be work-around. For option 2, listcat and sort should give you a go... _________________ Regards,
Anuj
Posted: Thu Mar 04, 2010 7:54 am Post subject: typo
Guys, sorry for the typo......
The input file is current generation (0) only and NOT (+1). The cobol program should pick the generation number from input file and write it to output along with other fields in record layout.
FILE-CONTROL.
SELECT INPUT-FILE ASSIGN TO INFILE
ORGANIZATION IS SEQUENTIAL
ACCESS IS SEQUENTIAL.
FILE-CONTROL.
SELECT DATASET-NAME-FILE ASSIGN TO DSNAME
ORGANIZATION IS SEQUENTIAL
ACCESS IS SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD INPUT-FILE
LABEL RECORD STANDARD
BLOCK 0 RECORDS
RECORDING MODE F
RECORD CONTAINS 80 CHARACTERS.
01 INPUT-RECORD PIC X(80).
FD DATASET-NAME-FILE
LABEL RECORD STANDARD
BLOCK 0 RECORDS
RECORDING MODE F
RECORD CONTAINS 80 CHARACTERS.
01 DATASET-NAME-RECORD.
03 DATASET-NAME PIC X(44).
03 FILLER PIC X(36).
PROCEDURE DIVISION.
MOVE 'GETGDG INFILE DSNAME' TO ARG-CHAR.
MOVE 80 TO ARG-SIZE.
MOVE 'IRXJCL' TO PGM-NAME.
CALL PGM-NAME USING ARGUMENT.
OPEN INPUT DATASET-NAME-FILE.
READ DATASET-NAME-FILE.
DISPLAY DATASET-NAME.
CLOSE DATASET-NAME-FILE.
MOVE ZEROS TO RETURN-CODE.
STOP RUN.
Posted: Thu Mar 04, 2010 11:51 am Post subject: thanks a lot
Hi,
Thanks a ton. The google link is also very helpful. I am going to try it out.
Would you post the solution if possible to achieve using IDCAMS.
Thanks a lot again. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Posted: Thu Mar 04, 2010 12:36 pm Post subject: ok
Thanks Kolusu. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
Posted: Thu Mar 04, 2010 1:11 pm Post subject:
If you want to find the info yourself, search the TIOT and JFCB control blocks. This can be done from COBOL and a search will find examples. I don't much care for the listcat solution because of the possibility of getting the wrong name due to concurrent jobs. If you must use the catalog, you can get the name quickly via a locate macro (SVC 26). Svc 99 can also get the name allocated to the ddname as has already been show via bpxwdyn. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Posted: Tue May 04, 2010 5:59 am Post subject: Thanks
Hi,
Thanks everyone ! _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum