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

maintaing the fixed number of records in file using Syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 199
Location: india

PostPosted: Fri Mar 28, 2008 4:01 pm
Reply with quote

Hi,

In my requirement I have a file say 'rajat.test.file' (FB/04) in which the number of records should always be made to 99. if the file 'rajat.test.file' is created with 24 records then above these 24 records there should hex. dec. count till 75 i.e (X'01' to X'4B') starting from col. postion 4 of length 1. Everytime the number of records in 'rajat.test.file' may vary. So dynmically the hex. dec. count values should be inserted above the records.

For example.

INPUT FILE i.e 'rajat.test.file'

Code:
=COLS> ----
****** ***
000001 CCX
000002 CC1
000003 CC2
000004 CC9
000005 EE1
000006 EE3
000007 EE8
000008 FFY
000009 FF2
000010 FF3
000011 FF9
000012 HH1
000013 HH2
000014 HH9
000015 KK8
000016 NNC
000017 NNY
000018 NN2
000019 NN4
000020 NN8
000021 SE6
000022 UU8
000023 YYE
000024 YYG



Then this file should be modified to :

Code:
=COLS> ----
****** ****
000001    X'01'
000002    X'02'
         .
         .
         .
         .
         .
         .
000075    X'4B'   
000076 CCX
000077 CC1
000078 CC2
000079 CC9
000080 EE1
000081 EE3
000082 EE8
000083 FFY
000084 FF2
000085 FF3
000086 FF9
000087 HH1
000088 HH2
000089 HH9
000090 KK8
000091 NNC
000092 NNY
000093 NN2
000094 NN4
000095 NN8
000096 SE6
000097 UU8
000098 YYE
000099 YYG



Thanks in advance,
Rajat
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Mar 28, 2008 9:15 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=... input file (FB/4)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//CTL3CNTL DD DSN=&&C3,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//IN4 DD *
DUMMY
//***>  USE A MOD DATA SET FOR //OUT
//OUT DD DISP=MOD,DSN=...  MOD output file (FB/4)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) TO(CTL3CNTL) USING(CTL2)
COPY FROM(IN4) TO(OUT) USING(CTL3)
COPY FROM(IN) TO(OUT)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
    TRAILER1=(COUNT=(EDIT=(TT)))
/*
//CTL2CNTL DD *
  INREC BUILD=(2X,
    C'OUTFIL FNAMES=OUT,BUILD=(4:SEQNUM,1,BI),REPEAT=',
      +99,SUB,1,2,ZD,EDIT=(TT),80:X)
/*
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 199
Location: india

PostPosted: Fri Mar 28, 2008 11:34 pm
Reply with quote

Hi Frank,

Thank you very much...I know this will definatly work with DFSORT but I wanted the solution in SYNCSORT.. actually now i realised that i posted in wrong section of fourm can you please move my Post to JCL section...

Thanks in advance...
Rajat

Title edited and topic relocated to JCL.
d.sch.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Sat Mar 29, 2008 2:10 am
Reply with quote

Rajat,

Frank's solution will work with SyncSort for z/OS 1.2.1 and later.
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 199
Location: india

PostPosted: Sat Mar 29, 2008 7:32 pm
Reply with quote

Yes, You are right I tried it now it is working fine... thanks...
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top