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
 

 

update VSAM file with the number of records through JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
s.rajashankar

New User


Joined: 20 Nov 2009
Posts: 4
Location: chennai

PostPosted: Thu Aug 12, 2010 11:59 am    Post subject: update VSAM file with the number of records through JCL
Reply with quote

HI,

my requirement is that i have to count the number of records from the input file and update the value in the vsam file,

Conditions:
1. Input is Flat file
2. output is VSAM file
3. output should have one record, in that two fields
Quote:
,one is key that is some XY from the input file and second field
should be the number of records

Please note no prog change, only one step, only into vsam file

Expected output(ex: say 26 records in the input file and XY in all the records which is location)
xy 26

Can this be done ?
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 Aug 12, 2010 12:04 pm    Post subject: Re: update VSAM file with the number of records through JCL
Reply with quote

s.rajashankar wrote:
Can this be done ?
Yes
Back to top
View user's profile Send private message
s.rajashankar

New User


Joined: 20 Nov 2009
Posts: 4
Location: chennai

PostPosted: Thu Aug 12, 2010 12:07 pm    Post subject: Reply to: update VSAM file with the number of records throug
Reply with quote

how??????????? can you code it
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 Aug 12, 2010 12:13 pm    Post subject:
Reply with quote

Which sort product do you use.

To find out which product and release level you have installed please run the job below and post the full sysout including the message codes.
Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
Back to top
View user's profile Send private message
s.rajashankar

New User


Joined: 20 Nov 2009
Posts: 4
Location: chennai

PostPosted: Thu Aug 12, 2010 12:40 pm    Post subject: Reply to: update VSAM file with the number of records throug
Reply with quote

hi,

i submitted the job you have given and my sysout are below


1ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 01:57 ON THU AUG 12, 2010 -
0 SORT FIELDS=COPY
ICE201I F RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K90013 C6-K90013 C7-K90000 C8-K42135 E9-K90013 C9-BASE E5-K44563 E7-K44563
ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED
ICE088I 0 TSAMPLE .SORTSTEP. , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=RC16 ,MSGDDN=SYSOUT
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=N ,ABCODE=MSG
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,STIMER=Y,COBEXIT=COB2
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=Y,DSA=0
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN
ICE751I 1 EF-K49534 F0-K49037 E8-K44563
ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 1, OUT: 1
ICE052I 0 END OF DFSORT
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 Aug 12, 2010 12:49 pm    Post subject:
Reply with quote

OK, this is what I have used in the past.
Code:
//ICETOOL  EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//IN1      DD DSN=input_data_set,DISP=SHR                         
//OUT      DD DSN=&&TEMP01,DISP=(,PASS),                         
//            SPACE=(TRK,(15,15),RLSE)                           
//OUFILE   DD SYSOUT=*                                           
//TOOLIN   DD *                                                   
  COPY FROM(IN1) TO(OUT) USING(CTL1)                             
//CTL1CNTL   DD *                                                 
  OPTION COPY                                                     
  OUTFIL FNAMES=OUFILE,REMOVECC,NODETAIL,TRAILER1=('XY',3X,COUNT)
You may have to search the forum for writing out to a VSAM cluster, or to amend the actual format of the output, but this works for me.
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 Aug 12, 2010 1:03 pm    Post subject:
Reply with quote

Please DO NOT post your question on multiple forums.
Back to top
View user's profile Send private message
s.rajashankar

New User


Joined: 20 Nov 2009
Posts: 4
Location: chennai

PostPosted: Thu Aug 12, 2010 5:57 pm    Post subject: Reply to: update VSAM file with the number of records throug
Reply with quote

Thank you very much for your support, but i was unable to do that in a single step i had done through two steps as below, step s1 to find count and step2 to repro from flat file to vsam file



//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//*
//SORTIN DD DISP=SHR,DSN=PMGT.X.GTP444.IP.TO.GTP410
//SORTOUT DD DSN=TMGT.X.TEST.COUNT.FILE,
// DISP=(NEW,CATLG,DELETE),
// DCB=*.SORTIN,
// SPACE=(CYL,(2,1),RLSE)
//*
//SYSIN DD *
INCLUDE COND=(5,1,BI,EQ,C'2')
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('XY',COUNT=(M11,LENGTH=8))
/*
//**************************************************************
//* REPRO INTO A VSAM FILE
//**************************************************************
//S2 EXEC PGM=IDCAMS,
// REGION=4M,
// COND=(0,NE)
//*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//*
//INFILE DD DSN=TMGT.X.TEST.COUNT.FILE,
// DISP=SHR
//*
//OUTFILE DD DSN=TMGT.RXS.TEST.VSAM.FILE,DISP=(MOD,CATLG,KEEP)
//*
//SYSIN DD DSN=SCLM.PRODM.IDCPARM(GTREPRO),DISP=SHR
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Thu Aug 12, 2010 11:09 pm    Post subject:
Reply with quote

Why do you think you need to use a second step to "REPRO" the file? DFSORT can write directly to a VSAM output file. Just point SORTOUT of step S1 to the VSAM output file.
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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