MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need to insert variable values in the record
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Dec 19, 2007 8:12 am    Post subject: Need to insert variable values in the record Reply with quote

Hi ,

I have a req i.e i need to create a output file in the following format

Code:

***************** Top of Data *******************************
LOAD  DATA RESUME YES LOG NO NOCOPYPEND                           
INTO TABLE C0C.T5987                                                 
PART 12 REPLACE KEEPDICTIONARY                                         
************** Bottom of Data *******************************


My problem is that the number 12 in the above format comes from differenet file as input and daily in that record we get only one record in that file and rest of the data inth above format is same every day.

Values in the file may be in this format

day1 value in the input file is

12

so the output should be

Code:

***************** Top of Data *******************************
LOAD  DATA RESUME YES LOG NO NOCOPYPEND                           
INTO TABLE C0C.T5987                                                 
PART 12 REPLACE KEEPDICTIONARY                                         
************** Bottom of Data *******************************


Day 2 value in the input file is

1,29,30,31

so the output should be

Code:

***************** Top of Data *******************************
LOAD  DATA RESUME YES LOG NO NOCOPYPEND                           
INTO TABLE C0C.T5987                                                 
PART  1,29,30,31 REPLACE KEEPDICTIONARY                                         
************** Bottom of Data *******************************


1,29,30,31 this is the maximum value we can get in the file for a pariticluar day.

So help me in this .

Thanks
Siva
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Dec 19, 2007 11:13 am    Post subject: Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed you wanted the output file to have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  day file
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY                                                     
  OUTFIL REMOVECC,                                               
     HEADER1=('LOAD  DATA RESUME YES LOG NO NOCOPYPEND',/,       
       'INTO TABLE C0C.T5987'),                                   
   IFOUTLEN=80,                                                   
   IFTHEN=(WHEN=INIT,                                             
     BUILD=(C'PART ',1,10,C' REPLACE KEEPDICTIONARY')),           
   IFTHEN=(WHEN=INIT,OVERLAY=(1,80,SQZ=(SHIFT=LEFT,MID=C' ')))   
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort


Last edited by Frank Yaeger on Wed Dec 19, 2007 11:35 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Dec 19, 2007 11:16 am    Post subject: Reply with quote

sivafdms,

Since you are building LOAD cards it does not matter if you have spaces in between , so here is a DFSORT JCL which will give you the desired results. I just put 2 records in the file to show you how it would generate for the min and max values.

Code:

//STEP0100 EXEC PGM=ICEMAN                                   
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                               
12                                                           
1,29,30,31                                                   
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                           
  OUTFIL BUILD=(C'LOAD  DATA RESUME YES LOG NO NOCOPYPEND',/,
                C'INTO TABLE C0C.T5987',/,                   
                C'PART ',                                     
                01,10,                                       
                C' REPLACE KEEPDICTIONARY',80:X)             
//*                                                           


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Dec 20, 2007 12:32 am    Post subject: Reply with quote

HI Frank,

I tried our code but it is giving error..
Code:

-------- PROCESSING SYSIN --------                                   
  OPTION COPY                                                       
  OUTFIL REMOVECC,                                                   
     HEADER1=('LOAD DATA RESUME YES LOG NO NOCOPYPEND',/,           
       'INTO TABLE C0C.T5987'),                                     
   IFOUTLEN=80,                                                     
   IFTHEN=(WHEN=INIT,                                               
     BUILD=(C'PART ',1,10,C' REPLACE KEEPDICTIONARY')),             
   IFTHEN=(WHEN=INIT,OVERLAY=(1,80,SQZ=(SHIFT=LEFT,MID=C' ')))       
E1 - DSS10065E - PARAMETER 'IFOUTLEN' IS UNIDENTIFIED.               
E2 - DSS10065E - PARAMETER 'SQZ' IS UNIDENTIFIED.                   
                                                                     
------- END OF UTILITY PROGRAM OUTPUT -------                       


Thanks,
Siva
Back to top
View user's profile Send private message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Dec 20, 2007 4:11 am    Post subject: Reply with quote

Kolusu,

Thanks for reply. this code completed half of my requirement.
This code well when the input record lenght is 10 , as i told u before the input records are not constant.

I want the o/p file not like this when i/p record is 11
Code:


********************** TOP OF DATA **********************************
LOAD  DATA RESUME YES LOG NO NOCOPYPEND                                         
INTO TABLE C0C.T5987                                                           
PART 11         REPLACE KEEPDICTIONARY                                         
******************* BOTTOM OF DATA ********************************

i don't want spaces , so i want the o/p like this

********************* TOP OF DATA **********************************
LOAD  DATA RESUME YES LOG NO NOCOPYPEND                                         
INTO TABLE C0C.T5987                                                           
PART 11 REPLACE KEEPDICTIONARY                                         
******************* BOTTOM OF DATA ********************************

Regards,
Siva
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Thu Dec 20, 2007 4:25 am    Post subject: Reply with quote

sivafdms,

Is it that your requirement needs to be done only thru sort?

If no, then few lines of REXX will do what you are looking for.
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Dec 20, 2007 6:25 am    Post subject: Reply with quote

Vivek,

I don't REXX....
anyway could u please provide the code

Thanks
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Dec 20, 2007 11:13 am    Post subject: Reply with quote

sivafdms wrote:
HI Frank,

I tried our code but it is giving error..
Code:

-------- PROCESSING SYSIN --------                                   
  OPTION COPY                                                       
  OUTFIL REMOVECC,                                                   
     HEADER1=('LOAD DATA RESUME YES LOG NO NOCOPYPEND',/,           
       'INTO TABLE C0C.T5987'),                                     
   IFOUTLEN=80,                                                     
   IFTHEN=(WHEN=INIT,                                               
     BUILD=(C'PART ',1,10,C' REPLACE KEEPDICTIONARY')),             
   IFTHEN=(WHEN=INIT,OVERLAY=(1,80,SQZ=(SHIFT=LEFT,MID=C' ')))       
E1 - DSS10065E - PARAMETER 'IFOUTLEN' IS UNIDENTIFIED.               
E2 - DSS10065E - PARAMETER 'SQZ' IS UNIDENTIFIED.                   
                                                                     
------- END OF UTILITY PROGRAM OUTPUT -------                       


Thanks,
Siva


Siva,

The above errors are NOT DFSORT error messages. They are from your JCL check software. Please run the job shown by Frank and it will give you the desired results.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Fri Dec 21, 2007 12:26 am    Post subject: Reply with quote

Hi Kolusu.

I tried the Frank code as it is but still giving errors
Code:

SYSIN :                                                                     
  OPTION COPY                                                               
   OUTFIL REMOVECC,                                                         
     HEADER1=('LOAD  DATA RESUME YES LOG NO NOCOPYPEND',/,                   
        'INTO TABLE C0C.T5987'),                                             
  IFOUTLEN=80,                                                             
  IFTHEN=(WHEN=INIT,BUILD=(C'PART ',1,10,C' REPLACE KEEPDICTIONARY')),     
                            *                                                           
    IFTHEN=(WHEN=INIT,OVERLAY=(1,80,SQZ=(SHIFT=LEFT,MID=C' ')))             
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR                                   
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                               
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                               


thanks,
Siva
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Dec 21, 2007 1:19 am    Post subject: Reply with quote

siva,
The job given by Frank worked fine for me. You are using SYNCSORT. As suggested by kolusu, you have to check software.


Last edited by vkphani on Fri Dec 21, 2007 1:52 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Fri Dec 21, 2007 1:41 am    Post subject: Reply with quote

sivafdms,
Frank's solution is using DFSORT and you are using SYNCSORT. So, it wont work for you.
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Fri Dec 21, 2007 2:49 pm    Post subject: Reply with quote

To clarify: ICE-prefixed messages indicate DFSORT, WER-prefixed ones indicate Syncsort regardless of the name of the program named in the PGM= statement.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Dec 26, 2007 12:34 am    Post subject: Reply with quote

Hi Terry,

This seems that my shop not using DFSORT.So how to invoke DFSORT.

Thanks,
Siva
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Dec 26, 2007 4:18 am    Post subject: Reply with quote

Quote:

This seems that my shop not using DFSORT.So how to invoke DFSORT

buy it? But you should be able to use SYNCSORT just as well.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Wed Dec 26, 2007 5:01 am    Post subject: Reply with quote

sivafdms,

Contact your system programmer to install DFSORT.


http://www.ibm.com/storage/dfsort/
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group