Hi All,
I was going through some of the JCL's which include VSAM's in their processing.
I have come across similar situation in many JCL's that 2 similar steps are present one after another when ever VSAM is involved.
The first step looks like copying data from VSAM file to a Flat file and the very next step is copying back data from Flat file to VSAM file.
Can some one throw some light if there any significance behind this?
I can see from comments that Step1 is called Securing(Backup) VSAM file by copying contents to Flat file and Step2 Restoring(Reload) where data is copied from Flat file back to VSAM.
Copying data back and forth between VSAM and Flat files
-
- Posts: 20
- Joined: Tue Jun 02, 2009 9:59 am
- Skillset: JCL and COBOL Beginner
- Referer: My Self
- Location: Bangalore
- Contact:
Copying data back and forth between VSAM and Flat files
Thanks Always,
-Rupesh.
-Rupesh.
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: Copying data back and forth between VSAM and Flat files
If the VSAM file is indexed (KSDS), inserting records can cause splits of the controlinterval and possibly even the controlarea. This can cause inefficient access and excess used space. Unloading the VSAM file, redefining it, and reloading the VSAM file is the only way to recover the space.
-
- Global moderator
- Posts: 3025
- Joined: Sun Jul 04, 2010 12:13 am
- Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
- Referer: Google
- Location: Pushing up the daisies (almost)
Re: Copying data back and forth between VSAM and Flat files
Also, by reading the backup right away you are ensuring its quality.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
Regards
Nic
-
- Posts: 20
- Joined: Tue Jun 02, 2009 9:59 am
- Skillset: JCL and COBOL Beginner
- Referer: My Self
- Location: Bangalore
- Contact:
Re: Copying data back and forth between VSAM and Flat files
Exactly, I got the same answer from a System Programmer here also couple of minutes ago that this process will remove CI and CA splits which improves the structure of the index.
One more point he added here is, some programmers code in this way to make the Restart mechanism easy in case of failures.
One more point he added here is, some programmers code in this way to make the Restart mechanism easy in case of failures.
Thanks Always,
-Rupesh.
-Rupesh.
-
- Posts: 39
- Joined: Wed Sep 01, 2010 9:12 pm
- Skillset: Operating Systems: MVS
Environment: Mainframe, Windows
Databases: VSAM, DB2 Tables
Programming Languages: COBOL, JCL,TSO/ISPF, CICS, DB2 (SQL),
Software Tools: File-AID, Endeavor, SORT, ICETOOL, SNDM, HP Quality Center,
OPC, DRMS,IDCAMS, SMARTIS, VISIO, Vision plus, HP(Service Manager),TSO,ISPF - Referer: google
Re: Copying data back and forth between VSAM and Flat files
Hi when any processing happens for VSAM file.
you will always see these steps ALWAYS :
Step1: Taking backup in flat file.
Step 2: Sorting the file on the key(if not sorted this will cause and error)
Step3: Copy back(REPRO) the data from flat file to VSAM..
you will always see these steps ALWAYS :
Step1: Taking backup in flat file.
Step 2: Sorting the file on the key(if not sorted this will cause and error)
Step3: Copy back(REPRO) the data from flat file to VSAM..
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: Copying data back and forth between VSAM and Flat files
ritikasingh, you are not correct. If there are no data changes, an IDCAMS REPRO to a sequential file will already be in key sequence, so there is absolutely no reason to run a sort before the loading back of the data into the VSAM file. There may be other processing going on that requires sorting the data but a straight unload / reload does not.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Copying All Data Off An Old Mainframe
by zunebuggy » Wed Sep 25, 2024 1:10 am » in Mainframe Security - 0
- 1596
-
by zunebuggy
View the latest post
Wed Sep 25, 2024 1:10 am
-
-
-
Joining 2 vb files into vsam files ended error
by newbiemainframe » Thu Nov 12, 2020 7:59 am » in JCL - 1
- 1752
-
by NicC
View the latest post
Thu Nov 12, 2020 7:15 pm
-
-
-
How to import a ZFS data file into VSAM catalog
by danik56 » Tue Nov 23, 2021 10:29 pm » in VSAM/SMS - 0
- 3405
-
by danik56
View the latest post
Tue Nov 23, 2021 10:29 pm
-
-
- 1
- 2559
-
by sergeyken
View the latest post
Fri Jun 25, 2021 10:55 pm
-
- 2
- 1425
-
by Robert Sample
View the latest post
Fri Oct 22, 2021 9:41 pm