View previous topic :: View next topic
|
Author |
Message |
kitchu84
New User
Joined: 02 Dec 2006 Posts: 33 Location: chennai
|
|
|
|
hi ,
my input file is like this: LRECL=100, RECFM=FB (File names are of varying lengths)
XXXX.ABC.FILE.ABBYS.LART.TEST.G1423V00 - GDG file
XXXX.MNO.FILE.SAMPLE.ART.TEST01.G0003V00 - GDG file
XXXX.KLM.FILE.TES101.G0203V00 -GDG file
XXXX.ABC.FILE.TEST - flat file
Output file should not contain GDG versioning in the file names
XXXX.ABC.FILE.ABBYS.LART.TEST - GDG file
XXXX.MNO.FILE.SAMPLE.ART.TEST - GDG file
XXXX.KLM.FILE.TES101 -GDG file
XXXX.ABC.FILE.TEST - flat file
I have SYNCSORT available . Can I achieve this without using COBOL |
|
Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10896 Location: italy
|
|
|
|
You /the powers of Your organization should revisit the requirement
a GDG datasetname/generation without the last qualifier is not a Dataset name any longer
it is a GDG base name
and why would You mix GDG base name with normal datasets ??? |
|
Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10896 Location: italy
|
|
|
|
follow on
the question might be reasonable if You only had GDGs
and wanted to check for orphans
( missing gdg bases/uncataloged datasets )
something very commendable for proper storage management
but the presence of a normal dataset is puzzling/baffling  |
|
Back to top |
|
 |
vasanthz
Global Moderator

Joined: 28 Aug 2007 Posts: 1747 Location: Tirupur, India
|
|
|
|
Hello,
You could try the below job for the requirement,
Code: |
//JS020 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SORTWK01 DD UNIT=SYSALLDA,SPACE=(CYL,1)
//SORTWK02 DD UNIT=SYSALLDA,SPACE=(CYL,1)
//SORTWK03 DD UNIT=SYSALLDA,SPACE=(CYL,1)
//SORTIN DD DSN=WELLS.SORTIN,DISP=SHR
//SORTOUT DD DSN=WELLS.SORTOUT,DISP=OLD
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(1,80,JFY=(SHIFT=RIGHT))
OUTREC IFTHEN=(WHEN=(72,1,CH,EQ,C'.',AND,
73,1,CH,EQ,C'G',AND,
74,1,SS,EQ,C'0123456789',AND,
75,1,SS,EQ,C'0123456789',AND,
76,1,SS,EQ,C'0123456789',AND,
77,1,SS,EQ,C'0123456789',AND,
78,1,CH,EQ,C'V',AND,
79,1,SS,EQ,C'0123456789',AND,
80,1,SS,EQ,C'0123456789'),
BUILD=(1,71,JFY=(SHIFT=LEFT))),
IFTHEN=(WHEN=NONE,BUILD=(1,80,JFY=(SHIFT=LEFT)))
/* |
Hope it helps. |
|
Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10896 Location: italy
|
|
|
|
Hi Vasanth
while the answer is perfect from a technical point of view
applying a perfect solution to a flaky requirement is prone to troubles, sooner or later !
it would still be nice to understand why the TS feels right to mix GDG bases with true datasets  |
|
Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Actually, given the terms used by the OP, and the expected output from the example, I raise the following question.
If the GDG versioning (not my choice of words) is to be removed, then surely the results would be
INPUT:
XXXX.ABC.FILE.ABBYS.LART.TEST.G1423V00 - GDG file
OUTPUT:
XXXX.ABC.FILE.ABBYS.LART.TEST.G1423V - GDG file
or perhaps
XXXX.ABC.FILE.ABBYS.LART.TEST.G1423 - GDG file
Am I being pedantic here by showing yet another misuse of terminology |
|
Back to top |
|
 |
vasanthz
Global Moderator

Joined: 28 Aug 2007 Posts: 1747 Location: Tirupur, India
|
|
|
|
Quote: |
it would still be nice to understand why the TS feels right to mix GDG bases with true datasets icon_cool.gif |
Wise words coming from experience of variety of things I agree with your point.
Sometimes I fail to recognize the true purpose of a requirement,
maybe its a communicable disease that I contracted from my client, like below...  |
|
Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10896 Location: italy
|
|
|
|
just curious and found this sort control cards alternative ( worked with dfsort )
Code: |
000016 SORT FIELDS=COPY
000017 INREC FIELDS=(1,80,JFY=(SHIFT=RIGHT))
000018 OUTREC IFTHEN=(WHEN=(72,1,CH,EQ,C'.',AND,
000019 73,1,CH,EQ,C'G',AND,
000020 78,1,CH,EQ,C'V',AND,
000021 74,4,FS,EQ,NUM,AND,
000022 79,2,FS,EQ,NUM),
000023 BUILD=(1,71,JFY=(SHIFT=LEFT))),
000024 IFTHEN=(WHEN=NONE,
000025 BUILD=(1,80,JFY=(SHIFT=LEFT)))
|
still puzzled about the mixup ! |
|
Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Also: a GDG dataset is not a specific type of dataset - it could be a flat (PS) dataset, a dump or whatever. Just follows a naming specification. I haven't tried it but I suppose it could be that you could catalog a dataset that is not a part of a GDG but has a dsn ending in the same format as a GDG. Must try it some time. |
|
Back to top |
|
 |
vasanthz
Global Moderator

Joined: 28 Aug 2007 Posts: 1747 Location: Tirupur, India
|
|
|
|
Hello,
Quote: |
it could be that you could catalog a dataset that is not a part of a GDG but has a dsn ending in the same format as a GDG |
I think this is not possible, tried allocating a dataset of the format
USERID.G1423V00
via 3.2 ISPF and it fails.
Not sure if there is any other way of doing this.
Regards, |
|
Back to top |
|
 |
kitchu84
New User
Joined: 02 Dec 2006 Posts: 33 Location: chennai
|
|
|
|
Thanks Vasanthz, Enrico - it worked really well.
Now I can use it to suit my requirements.
[/code] |
|
Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10896 Location: italy
|
|
|
|
it would be nice on Your side , since we spent time giving You a solution,
to tell us the illogic reason for mixing up GCG bases and normal datasets
but naturally You did not care to acknowledge this previously expressed wish, uhu ??? |
|
Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
vasanthz, I tried with IEFBR14 and got back
Code: |
IEF344I RS0BR14 IEFBR14 DD0 - ALLOCATION FAILED DUE TO DATA FACILITY SYSTEM ERRO
IGD17100I UNEXPECTED CATALOG ERROR FOR DATA SET
XXXXXXX.TESTNGDG.G9876V00
RETURN CODE IS 8 REASON CODE IS 40 IGG0CLEH |
which comes back as
Quote: |
40 Explanation: A DEFINE GDG command was not issued prior to the DEFINE NONVSAM command with GDG entry name.
Programmer Response: Ensure that the GDG base is defined prior to defining the non-VSAM with a GDG entry name. |
So it looks like the system checks and won't catalog anything with GnnnnVnn as the last level of the data set name. |
|
Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Ah - I was just about to play with that. Saved me some (minimal) effort, Robert!!! |
|
Back to top |
|
 |
kitchu84
New User
Joined: 02 Dec 2006 Posts: 33 Location: chennai
|
|
|
|
hey Enrico ,
Yea Ofcourse I was about to post the details... I am also multi tasking with other office work as well, just though to thank u first and then provide a detailed explainations once I reach home.
I have requirement to get the exact file names being used in a JCL and their counts .
1. At the end of all the job steps, I am planning to read the JESYSMS while the job is running and then extract all the exact filenames being used in the JOb. (Filenames could be a GDG version or Flat file both).
2.Now in the earlier job steps which use the i/p files and create the o/p datasets. I am planning to create a report file containing names of the files and their counts. However these file names will not be exact filenames. (these will not have exact GDG version numbers)
3. Now i need to compare the exact file names in Step 1 (excluding GDG version) and Step2 (which contains file names and counts) and then finally create a FINAL file with exact filename and counts.
Not sure if this sounds confusing. Please let me know. |
|
Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10896 Location: italy
|
|
|
|
counts of what ...
do not tell me that You want to count the record of each file  |
|
Back to top |
|
 |
kitchu84
New User
Joined: 02 Dec 2006 Posts: 33 Location: chennai
|
|
|
|
To add to it :
Since I need to match on 2 files one with exact file names and other file
base file name and count. I asked this query.
Also, I tried changing the sort card to achieve this.
Input file: LERCL=100,RECFM=FB
File Name: 80 bytes(1:80) - last 9 bytes are for version number EX: '.G1423V00'
File count : 11 bytes(90:11)
last bytes view of the input file:
+----9----+----0
****************
00024560010
00003300010
00330330010
00000005510
Sort Card I used:
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(1,80,JFY=(SHIFT=RIGHT),90,11)
OUTREC IFTHEN=(WHEN=(72,1,CH,EQ,C'.',AND,
73,1,CH,EQ,C'G',AND,
78,1,CH,EQ,C'V',AND,
74,4,FS,EQ,NUM,AND,
79,2,FS,EQ,NUM),
BUILD=(1,71,JFY=(SHIFT=LEFT),72:72,9,90:90,11)),
IFTHEN=(WHEN=NONE,
BUILD=(1,80,JFY=(SHIFT=LEFT),90:90,11))
/*
Output that I got :
LRECL=100,RECFM=80
I am getting first 71 bytes of file names correctly
Next 9 bytes of version number also properly starting position 72. But the
file counts are not coming at position 90 correctly.
last bytes view of the output file:
7----+----8----+----9----+----0
*******************************
.G1423V00 10
.G0003V00 10
.G0203V00 10
10
Please suggest me. |
|
Back to top |
|
 |
kitchu84
New User
Joined: 02 Dec 2006 Posts: 33 Location: chennai
|
|
|
|
Pardon me for the file snapshots, it is not alinged properly while pasting ... |
|
Back to top |
|
 |
kitchu84
New User
Joined: 02 Dec 2006 Posts: 33 Location: chennai
|
|
|
|
At enrico:
"counts of what ...
do not tell me that You want to count the record of each file "
Yes we need the count of files being used in the job. However, it will be upto our discretion for which files we want to display the counts. So now we are planning to make changes to existing cobols/ezt that create that file or call ICETOOL to get the file counts. For volume intensive files, we might not want to call ICETOOL, just that we will make change to modules to have the counts displayed while creating the files itself. |
|
Back to top |
|
 |
|
|