IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Adding a Dummy Record in a empty file through DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vinodc

New User


Joined: 01 Dec 2005
Posts: 33
Location: Prague

PostPosted: Tue Mar 14, 2006 5:48 pm
Reply with quote

Hi,

Need a small help. I need to add a dummy record to a VSAM file using DFSORT.

The file is VSAM fixed length KSDS with length 425. The file is created in a job and in next step a program uses that file in IO mode. But as the file is empty, the program abends. So I wanted to add a dummy record to the file.
The record should be -
000DUMMY-HEADER0000000

I tried using REPROing this record using instream data, but job abended because the job uses PROC and instream data is not allowed in PROCS.

Please let me know how this can be acheived through DFSORT.
Back to top
View user's profile Send private message
BruceC

New User


Joined: 14 Mar 2006
Posts: 6
Location: Los Angeles

PostPosted: Tue Mar 14, 2006 9:45 pm
Reply with quote

Here is one way. I tested it with a sequential dataset but SORT can load a new KSDS cluster.
YOUR.JCL.LIB(INITKSDS) contains overrides:

Code:

//TESTINIT (JOBCARD...) 
//*
//  JCLLIB ORDER=(YOUR.TEST.PROCLIB)
//*
//INIT001 EXEC VINODC,
//         OUT1='*'
//*
//* Override SORTIN to load initial data
//STEP010.SORTIN DD *
000DUMMY-HEADER0000000
//*
//STEP010.SYSIN DD *
  OPTION COPY
//*
//STEP020.SYSIN DD *
  OPTION COPY
  OUTREC FIELDS=(1,22,403X)
//*
//STEP030.SYSIN DD *
  OPTION COPY
//*


YOUR.TEST.PROCLIB(VINODC) contains:

Code:

//VINODC   PROC
//*
//* Create an initialization record and load it to a new KSDS cluster
//*------------------------------------------------------------------*
//*     Create initialization data                                   *
//*------------------------------------------------------------------*
//STEP010 EXEC PGM=SORT,COND=(4,LT)
//SYSOUT   DD SYSOUT=&OUT1
//SYSPRINT DD SYSOUT=&OUT1
//SORTIN   DD DUMMY
//SORTOUT  DD DSN=&&DUMMY1,DISP=(NEW,PASS),
//        UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE),
//        RECFM=F,LRECL=22
//SYSIN    DD DUMMY
//*
//*------------------------------------------------------------------*
//*     Pad initialization record to correct length                  *
//*------------------------------------------------------------------*
//STEP020 EXEC PGM=SORT,COND=(4,LT)
//SYSOUT   DD SYSOUT=&OUT1
//SYSPRINT DD SYSOUT=&OUT1
//SORTIN   DD DSN=&&DUMMY1,DISP=(OLD,PASS)
//SORTOUT  DD DSN=&&DUMMY2,DISP=(NEW,PASS),
//        UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE),
//        RECFM=FB,LRECL=425
//SYSIN    DD DUMMY
//*
//*--------------------------------------------------------------------*
//* Drop test file, a sequential file in this case
//*--------------------------------------------------------------------*
//STEP030R EXEC PGM=IEFBR14
//DD01     DD DSN=LAPR.LABTC.TESTDSN,
//       DISP=(MOD,DELETE,DELETE),
//       UNIT=SYSDA,SPACE=(TRK,1),
//       RECFM=FB,LRECL=425
//*--------------------------------------------------------------------*
//* Initialize the dataset
//*--------------------------------------------------------------------*
//STEP030  EXEC PGM=SORT,COND=(4,LT)
//SYSOUT   DD SYSOUT=&OUT1
//SYSPRINT DD SYSOUT=&OUT1
//*
//SORTIN   DD DSN=&&DUMMY2,DISP=(OLD,PASS)
//SORTOUT  DD DSN=LAPR.LABTC.TESTDSN,
//       DISP=(NEW,CATLG,DELETE),
//       UNIT=SYSDA,
//       SPACE=(TRK,(01,01),RLSE),RECFM=FB,LRECL=425
//*
//SYSIN DD DUMMY
//*
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Tue Mar 14, 2006 9:51 pm
Reply with quote

hy Vinodc,

note:
if you have a KSDS defined,
the index part is not physically present.
You must insert first a dummy record,
for that index part is created, after
you can delete this dummy record,
but the index part remains existing,
even it is empty.

this is why your program abends.

martin9
Back to top
View user's profile Send private message
Vinodc

New User


Joined: 01 Dec 2005
Posts: 33
Location: Prague

PostPosted: Tue Mar 14, 2006 10:17 pm
Reply with quote

Hi BruceC,
Thanks so much for your response. Your way uses the instream data, though through override from JCL. But icon_sad.gif , my limitation is I cant use it as it cant be used in PROC and I dont want to give override in JCL.

Hi martin9,
Thanks for explaining the cause of abend. But problem still remains to add the dummy record.

Isnt there any way to insert the dummy record through SORT parameters (Like the way it is used to insert header in reports using OUTFIL HEADER1
)?
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Wed Mar 15, 2006 12:00 am
Reply with quote

hy Vinodc,

try to use IDCAMS this is the better utility to do it.
therefore create any sequential dataset with the same lrecl as the vsam cluster. make a repro with this dataset (which has only one string).
note: the seq. dataset should be recfm=vb...

martin9
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top