Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Removing last 8 bytes for gdg file names

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kitchu84

New User


Joined: 02 Dec 2006
Posts: 33
Location: chennai

PostPosted: Thu May 19, 2011 11:53 am    Post subject: Removing last 8 bytes for gdg file names
Reply with quote

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
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu May 19, 2011 11:58 am    Post subject: Reply to: Removing last 8 bytes for gdg file names
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu May 19, 2011 12:02 pm    Post subject: Reply to: Removing last 8 bytes for gdg file names
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu May 19, 2011 1:42 pm    Post subject: Reply to: Removing last 8 bytes for gdg file names
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu May 19, 2011 1:47 pm    Post subject: Reply to: Removing last 8 bytes for gdg file names
Reply with quote

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 icon_cool.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu May 19, 2011 1:58 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu May 19, 2011 2:09 pm    Post subject:
Reply with quote

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 icon_smile.gif 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... icon_biggrin.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu May 19, 2011 2:10 pm    Post subject: Reply to: Removing last 8 bytes for gdg file names
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1716
Location: UK

PostPosted: Thu May 19, 2011 2:53 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu May 19, 2011 2:58 pm    Post subject:
Reply with quote

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
View user's profile Send private message
kitchu84

New User


Joined: 02 Dec 2006
Posts: 33
Location: chennai

PostPosted: Fri May 20, 2011 12:22 am    Post subject:
Reply with quote

Thanks Vasanthz, Enrico - it worked really well.

Now I can use it to suit my requirements.


[/code]
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri May 20, 2011 12:30 am    Post subject: Reply to: Removing last 8 bytes for gdg file names
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri May 20, 2011 12:34 am    Post subject:
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1716
Location: UK

PostPosted: Fri May 20, 2011 12:58 am    Post subject:
Reply with quote

Ah - I was just about to play with that. Saved me some (minimal) effort, Robert!!!
Back to top
View user's profile Send private message
kitchu84

New User


Joined: 02 Dec 2006
Posts: 33
Location: chennai

PostPosted: Fri May 20, 2011 1:04 am    Post subject: Reply to: Removing last 8 bytes for gdg file names
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri May 20, 2011 1:19 am    Post subject: Reply to: Removing last 8 bytes for gdg file names
Reply with quote

counts of what ...
do not tell me that You want to count the record of each file icon_eek.gif
Back to top
View user's profile Send private message
kitchu84

New User


Joined: 02 Dec 2006
Posts: 33
Location: chennai

PostPosted: Fri May 20, 2011 1:22 am    Post subject: Reply to: Removing last 8 bytes for gdg file names
Reply with quote

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
View user's profile Send private message
kitchu84

New User


Joined: 02 Dec 2006
Posts: 33
Location: chennai

PostPosted: Fri May 20, 2011 1:23 am    Post subject:
Reply with quote

Pardon me for the file snapshots, it is not alinged properly while pasting ...
Back to top
View user's profile Send private message
kitchu84

New User


Joined: 02 Dec 2006
Posts: 33
Location: chennai

PostPosted: Fri May 20, 2011 1:28 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 1 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us