Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Adding a Dummy Record in a empty file through DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Adding a Dummy Record in a empty file through DFSORT
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    Post subject: Re: Adding a Dummy Record in a empty file through DFSORT
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    Post subject:
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    Post subject: Adding a Dummy Record in a empty file through DFSORT
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us