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
 

 

Can we do it using DFSORT?

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

New User


Joined: 11 Jan 2010
Posts: 13
Location: chennai/hyderabad

PostPosted: Thu May 12, 2011 5:57 pm    Post subject: Can we do it using DFSORT?
Reply with quote

Hi,

I seek a help in completing this task, If possible could you please help me..

Here is the requirement.

Step 1. I have a daily job which runs and create a file with few/more records daily. I would like to count(count will vary day by day) the number of records are present in that particular input file.

Step 2. Once i get the Count from step 1, I want to write that count in another file which has some description say example
_________________________________________
Welcome,

Today the record process from our System is : Count-value(the actual count from the step 1 should get printed here)

Thank you
_________________________________________
The above description i wrote in an input file so that every day we can just update the actual count in the COUNT-VALUE field

my approach,

I have got the count using FILEAID utility (TALLY), but i am not able to guess how to override a input file which has the description with the count

I believe override can be done using DFSORT, I tried all the possibility but not able to complete my requirement.

If some one have time please help me out..

Many thanks in advance

Regards
Raghu
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Thu May 12, 2011 6:16 pm    Post subject:
Reply with quote

So you have a count in one file as the only record in the file and you want to overlay it on a specific record in a specific position in a second file?

What is the length of the count field in the first file? Is the count in Packed Decimal or Zoned Decimal format?

You want the count overlaying the 3rd record of the second file at position 47 (I think it is)?

Is this second file going to be read by machine or by human? If the former then you do not need all that verbiage and you do not need a second file - just the count.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu May 12, 2011 7:33 pm    Post subject:
Reply with quote

If I understand your requirement correctly..
Below one step will give you desired...
Code:

//S1    EXEC  PGM=SORT                                       
//SORTIN DD *                                                 
THIS IS THE FILE OF                                           
WHICH COUNT IS TO BE                                         
PRINTED ON OUTPUT FILE                                       
//SORTOUT DD SYSOUT=*                                         
//SYSOUT    DD  SYSOUT=*                                     
//SYSIN    DD  *                                             
  SORT FIELDS=COPY                                           
  OUTFIL REMOVECC,NODETAIL,                                   
  TRAILER1=('_________________________________________',/,   
  'Welcome,',/,                                               
  'Today the record process from our System is :',           
   COUNT=(M11,LENGTH=6),/,                                   
  'Thank you',/,                                             
  '_________________________________________')               

Output will be
Code:

_________________________________________               
Welcome,                                               
Today the record process from our System is :000003     
Thank you                                               
_________________________________________               
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu May 12, 2011 9:20 pm    Post subject:
Reply with quote

Quote:

The above description i wrote in an input file so that every day we can just update the actual count in the COUNT-VALUE field


Well... I wont go with this way.. But you have STATIC content and exepcted to change often ( icon_rolleyes.gif ) .... And every time you don't want to touch JCL..
Code:

//S1    EXEC  PGM=SORT                                         
//SORTIN DD *                                                   
THIS IS THE FILE OF                                             
WHICH COUNT IS TO BE                                           
PRINTED ON OUTPUT FILE                                         
//SORTOUT DD DSN=&&TEMP,DISP=(NEW,PASS)                         
//SYSOUT    DD  SYSOUT=*                                       
//SYSIN    DD  *                                               
  SORT FIELDS=COPY                                             
  OUTFIL REMOVECC,NODETAIL,                                     
  TRAILER1=(C'FCOUNT',C',''',COUNT=(M11,LENGTH=6),'''',80:X)   
/*                                                             
//S2    EXEC  PGM=SORT                                         
//SORTIN DD *                                                   
_________________________________________                       
WELCOME,                                                       
TODAY THE RECORD PROCESS FROM OUR SYSTEM IS :XXXXXX             
THANK YOU                                                       
_________________________________________                       
//SORTOUT  DD SYSOUT=*                                     
//SYMNAMES DD DSN=&&TEMP,DISP=(MOD,PASS)                   
//SYSOUT   DD  SYSOUT=*                                   
//SYSIN    DD  *                                           
  OPTION COPY                                             
  INREC IFTHEN=(WHEN=(1,45,CH,EQ,                         
  C'TODAY THE RECORD PROCESS FROM OUR SYSTEM IS :'),       
  OVERLAY=(46:FCOUNT))                                     
/*                                                         
Back to top
View user's profile Send private message
ragbose

New User


Joined: 11 Jan 2010
Posts: 13
Location: chennai/hyderabad

PostPosted: Fri May 13, 2011 4:48 pm    Post subject: Reply to: Can we do it using DFSORT?
Reply with quote

Hi,

Thank you so much for your reply,

I have tried the below but I am not able to complete my requirement

Let me explain the requirement briefly
I create a PS file with the below decription
FILE NAME : TEST.DESCRIPTION --- LRECL - 80 and FB
TEST.DESCRIPTION contains
. Hi,
. PES Job Monitored Date:
. PES Job Monitored Time: 4:30 AM EST (2:00 PM IST)
. Status: File Creation Successful
. Number of Rows in the File : XXXXXX

XXXXXX -> where i want to my input record count daily.

Input file ( LRECL - 80 and FB) will have N number of records daily and it is not the same every day.

The JCL i used,

Code:

//S1    EXEC  PGM=SORT                                       
//SORTIN   DD  DSN=TEST.INPUTFILE,DISP=SHR       
//SORTOUT DD DSN=&&TEMP,DISP=(NEW,PASS)                     
//SYSOUT    DD  SYSOUT=*                                   
//SYSIN    DD  *                                             
  SORT FIELDS=COPY                                           
  OUTFIL REMOVECC,NODETAIL,                                 
  TRAILER1=(C'FCOUNT',C',''',COUNT=(M11,LENGTH=6),'''',80:X)
/*                                                           
//S2    EXEC  PGM=SORT                                         
//SORTIN   DD DSN=TEST.DESCRIPTION,DISP=SHR           
//SORTOUT  DD DSN=TEST.OUT,                         
//            DISP=(,CATLG,DELETE),SPACE=(100,(10,05),RLSE)                                 
//SYMNAMES DD DSN=&&TEMP,DISP=(OLD,DELETE)                     
//SYSOUT   DD  SYSOUT=*                                         
//SYSIN    DD  *                                               
  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=(1,36,CH,EQ,                               
        C'.       NUMBER OF ROWS IN THE FILE :'),               
    OVERLAY=(38:FCOUNT))                                       
/*


Position 38 where i want my XXXXXX to be place every day.

When i ran this JCL i got S013 but S1 step run fine i could see FCOUNT value

JCL error Msg as below,
IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=013 REASON CODE=00000020
TIME=01.49.45 SEQ=48497 CPU=0000 ASID=021E
PSW AT TIME OF ERROR 075C1000 80E1D0E2 ILC 2 INTC 0D
NO ACTIVE MODULE FOUND
NAME=UNKNOWN
DATA AT PSW 00E1D0DC - 41003B9A 0A0D41F0 38C256F0
AR/GR 0: 982BBE16/00000000_00E1D3C4 1: 00000000/00000000_A4013000
2: 00000000/00000000_0001A640 3: 00000000/00000000_00E1C82A
4: 00000000/00000000_007DF410 5: 00000000/00000000_007DF7A4
6: 00000000/00000000_007DF74C 7: 00000000/00000000_007DF7A4
8: 00000000/00000000_007DF76C 9: 00000000/00000000_007BA03C
A: 00000000/00000000_00ED52E0 B: 00000000/00000000_00000000
C: 00000000/00000000_0000002D D: 00000000/00000000_0000015D
E: 00000000/00000000_80E1C962 F: 00000002/00000010_00000020
END OF SYMPTOM DUMP
IEF472I CAB6788Y S2 - COMPLETION CODE - SYSTEM=013 USER=0000 REASON=000

I request you to kindly help me to complete this task.

I Apologies for any inconvenience caused due to this.


Thanks a lot
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri May 13, 2011 5:02 pm    Post subject:
Reply with quote

Fix the obvious error in the conflicting SPACE and DCB parameters for S2.SORTOUT.
Back to top
View user's profile Send private message
ragbose

New User


Joined: 11 Jan 2010
Posts: 13
Location: chennai/hyderabad

PostPosted: Mon May 16, 2011 9:01 am    Post subject: Reply to: Can we do it using DFSORT?
Reply with quote

Hi Akatsukami,

I have used the Escapa JCL for my requirement and he specified //SORTOUT DD SYSOUT=*. I have tried that also still facing the same issue,

I have question here is does FCOUNT(In S2 step) actually takes the value from S1 Step?

I even Provided all the required information but I am still facing the above mentioned issue.

Can any 1 help me?

Thanks in advance
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon May 16, 2011 5:52 pm    Post subject:
Reply with quote

There is something which you are not telling us.... Because code I gave is tested one....

However .. Just wanted to clarify..
Code:

//SORTIN   DD DSN=TEST.DESCRIPTION ,DISP=SHR           

are you sure there is space between dataset name and DISP position parameter?
Because ,DISP=SHR will be treated as comment here...
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Mon May 16, 2011 5:57 pm    Post subject: Reply to: Can we do it using DFSORT?
Reply with quote

Raghu, it would help if you would post the entire output of the SYSOUT DD statements for both steps.
Back to top
View user's profile Send private message
ragbose

New User


Joined: 11 Jan 2010
Posts: 13
Location: chennai/hyderabad

PostPosted: Tue May 17, 2011 1:57 pm    Post subject: Reply to: Can we do it using DFSORT?
Reply with quote

Code:

//SORTIN DD DSN=TEST.DESCRIPTION ,DISP=SHR


are you sure there is space between dataset name and DISP position parameter?

@ Escapa : Yes Escapa I do agree with you.. But i have never given a space btwn them.

@Superk : I apologies for the delay in response... I fixed the s013 abend sorry for not providing the sysout as i deleted all of them.

Now to tell you where i stand with respect to my requirement is,
I have a file which hold the record count
Say example : Test.Count --PS, Fixed and 80 bytes length
Step i used as per Escapa advise,

Code:

//STEP1    EXEC  PGM=SORT                                           
//SORTIN DD DSN=TESTA.INPUT.FILE(0),DISP=SHR  -- GDG always take current generation so we dont need to change the input file
//SORTOUT  DD DSN=TESTA.COUNT,                           
//            DISP=(NEW,CATLG,DELETE),SPACE=(80,(10,05),RLSE),   
//            DCB=(LRECL=80,RECFM=FB,DSORG=PS),AVGREC=K         
//SYSOUT    DD  SYSOUT=*                                         
//SYSPRINT  DD  SYSOUT=*                                         
//SYSIN    DD  *                                                 
  SORT FIELDS=COPY                                               
  OUTFIL REMOVECC,NODETAIL,                                     
  TRAILER1=(C'FCOUNT',C',''',COUNT=(M11,LENGTH=6),'''',80:X)     
/*     


Below is the result from Step 1

Test.Count(PS file)
---------------------
FCOUNT,'000200'
----------------------

While i try to keep 000200 value in the description file I.e Test.description (PS, Fixed and 80 bytes length) i am not getting the desired result.

TEST.DESCRIPTION(PS)
---------------------------
.
. Hi,
. Job Monitored Date:
. Job Monitored Time: 4:30 AM EST (2:00 PM IST)
. Status: File Creation Successful
. Number of Rows in the File : 000200 -- Cols (38 Position)
.
.
.Thanks,

I need the above mentioned output.

Expect the Count(000200) everything wil be same every day so we dont need to change the content of description file.

Now I just need to know how to place FCOUNT Value in 38th position every day without changing the JCL

I am really sorry if i have disturbed so much... but i have no other option to ask any one.. Apologies

Thanks
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue May 17, 2011 5:22 pm    Post subject:
Reply with quote

Are you providing the matching criteria correctly in your second step, the criteria you provided in the jcl is different from the file contents of your test description file. As this step is tested already it should be an issue with your editing of the step.

I would suggest you post the entire JCL after all your editing, along with the contents of the test description file.


Quote:
please use appropriate Tags while posting
Back to top
View user's profile Send private message
ragbose

New User


Joined: 11 Jan 2010
Posts: 13
Location: chennai/hyderabad

PostPosted: Thu May 19, 2011 2:45 pm    Post subject: Reply to: Can we do it using DFSORT?
Reply with quote

Hi,

With the help of you guys, I have done with my requirement thank you so much for the help,

JCL i used
---------

Code:

//TESTJOB JOB (,TESTA,),                                     
//     MSGLEVEL=(1,1),CLASS=Y,TIME=(90,59)                     
//**************************************************************
//STEP001    EXEC  PGM=SORT                                         
//SORTIN   DD  DSN=TESTA.RECORD(0),DISP=SHR           
//SORTOUT  DD DSN=TESTA.COUNT.TEST1,                   
//            DISP=(,CATLG,DELETE),SPACE=(80,(10,05),RLSE), 
//            DCB=(LRECL=80,RECFM=FB,DSORG=PS),AVGREC=K         
//SYSOUT    DD  SYSOUT=*                                       
//SYSPRINT  DD  SYSOUT=*                                       
//SYSIN    DD  *                                               
  SORT FIELDS=COPY                                             
  OUTFIL REMOVECC,NODETAIL,                                     
  TRAILER1=(C'FCOUNT',C',''',COUNT=(M11,LENGTH=6),'''',80:X)   
/*         

//STEP002    EXEC  PGM=SORT                                             
//SORTIN   DD DSN=TESTA.EMAIL.OUTPUT,DISP=SHR             
//SORTOUT  DD DSN=TESTA.RAGHU.FINAL,                     
//            DISP=(NEW,CATLG,DELETE),SPACE=(80,(10,05),RLSE),     
//            DCB=(LRECL=80,RECFM=FB,DSORG=PS),AVGREC=K           
//SYSPRINT DD SYSOUT=*                                             
//SYMNAMES DD DSN=TESTA.COUNT.TEST1,DISP=SHR               
//SYSOUT   DD  SYSOUT=*                                           
//SYSIN    DD  *                                                   
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=(38,6,CH,EQ,C'XXXXXX'),                       
    OVERLAY=(38:FCOUNT))                                           
/*     
                                                       
STEP002.SORTIN
----------------
.                                                             
. Hi,                                                         
.      Job Monitored Date:                               
.      Job Monitored Time: 4:30 AM EST (2:00 PM IST)     
.      Status: File Creation Successful                       
.      Number of Rows in the File : XXXXXX                   
.                                                             
.                                                             
.Thanks,                                                                                           

STEP002.SORTOUT
------------------
. Hi,                                                             
.       Job Monitored Date:                                   
.       Job Monitored Time: 4:30 AM EST (2:00 PM IST)         
.       Status: File Creation Successful                           
.       Number of Rows in the File : 000280                       
.                                                                 
.                                                                 
.Thanks,


I sincerely thanking each and every one for spending time and helping me.
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 How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts DFSORT to match two files and write John F Dutcher DFSORT/ICETOOL 6 Thu May 12, 2016 5:17 pm


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