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
 
Writing multiple records into a CSV report

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

Active User


Joined: 14 Dec 2008
Posts: 106
Location: India

PostPosted: Wed Nov 07, 2018 2:35 pm    Post subject: Writing multiple records into a CSV report
Reply with quote

Input File:
(Included line numbers for reference)
Code:

123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
FOFAC001 016 FOFAC001 LO       000 UNIX 086848 011915 000 000 0228  18310/0030
        ------------------------- AGENT INFORMATION  -------------------------
        Job Type: UNIX_JOB                                                   
        Agent:  LINUX_01ABHK                                                 
        Userid: UMIKE001                                                     
        -------------------------------- PROSE --------------------------------
        DESCRIPTION:                                                           
        WR0000000/DTLKU/12-14-16 --REQ AND TRIGGERBY UPDATED                   
        --------------------------- TRIGGERED JOBS ----------------------------
           JOB=BOFAC001 SCHID=000      QTM=0100 LEADTM=0000 SUBMTM=0000       
           JOB=COFAC001 SCHID=000      QTM=0100 LEADTM=0000 SUBMTM=0000       
           JOB=DOFAC001 SCHID=000      QTM=0100 LEADTM=0000 SUBMTM=0000       
FOFAC002 016 FOFAC001 LO       000 UNIX 086848 011915 000 000 0228  18310/0030
        ---------------- REQUIREMENTS AND NETWORK CONNECTIONS -----------------
           JOB=BOFAC001 SCHID=000      QTM=0100 LEADTM=0000 SUBMTM=0000       
           JOB=MOFAC001 SCHID=000      QTM=0100 LEADTM=0000 SUBMTM=0000       


Output Report Required:
(Included line numbers for reference)
Code:

12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
JOBNAME ,LASTRUN   ,JOBTYPE ,AGENT       ,USERID  ,TRIGGERED JOBS            ,REQ JOBS
FOFAC001,18310/0030,UNIX_JOB,LINUX_01ABHK,UMIKE001,BOFAC001;COFAC001;DOFAC001,
FOFAC002,18310/0030,        ,            ,        ,                          ,BOFAC001;MOFAC001


I tried the below code and was able to group records. I also tried INREC IFTHEN but couldn't get required results. Please help. The 'PROSE' section under each job could be ignored, each job in a particular section is delimited by a ';'.
Code:
//SYSIN    DD  *                                                   
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=GROUP,                                       
        BEGIN=(2,3,CH,NE,C' '),PUSH=(85:2,8))                     
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(95:SEQNUM,3,ZD,RESTART=(85,8)))
/*

Code:

12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
FOFAC001 016 FOFAC001 LO       000 UNIX 086848 011915 000 000 0228  18310/0030   FOFAC001 001
        ------------------------- AGENT INFORMATION  -------------------------   FOFAC001 002
        Job Type: UNIX_JOB                                                       FOFAC001 003
        Agent:  LINUX_01ABHK                                                     FOFAC001 004
        Userid: UMIKE001                                                         FOFAC001 005
        -------------------------------- PROSE --------------------------------  FOFAC001 006
        DESCRIPTION:                                                             FOFAC001 007
        WR0000000/DTLKU/12-14-16 --REQ AND TRIGGERBY UPDATED                     FOFAC001 008
        --------------------------- TRIGGERED JOBS ----------------------------  FOFAC001 009
           JOB=BOFAC001 SCHID=000      QTM=0100 LEADTM=0000 SUBMTM=0000          FOFAC001 010
           JOB=COFAC001 SCHID=000      QTM=0100 LEADTM=0000 SUBMTM=0000          FOFAC001 011
           JOB=DOFAC001 SCHID=000      QTM=0100 LEADTM=0000 SUBMTM=0000          FOFAC001 012
FOFAC002 016 FOFAC001 LO       000 UNIX 086848 011915 000 000 0228  18310/0030   FOFAC002 001
        ---------------- REQUIREMENTS AND NETWORK CONNECTIONS -----------------  FOFAC002 002
           JOB=BOFAC001 SCHID=000      QTM=0100 LEADTM=0000 SUBMTM=0000          FOFAC002 003
           JOB=MOFAC001 SCHID=000      QTM=0100 LEADTM=0000 SUBMTM=0000          FOFAC002 004
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2423
Location: @my desk

PostPosted: Wed Nov 07, 2018 6:33 pm    Post subject:
Reply with quote

hiravibk,

A couple of questions.

What are the criteria that determine 'TRIGGERED JOBS' vs 'REQ JOBS'?

Quote:
The 'PROSE' section under each job could be ignored
Did not really get what you meant by this, could you explain further? Looks like all the job names that you need in the output are technically below the 'PROSE section'.
Back to top
View user's profile Send private message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 106
Location: India

PostPosted: Wed Nov 07, 2018 10:52 pm    Post subject:
Reply with quote

Arun Raj wrote:
hiravibk,

A couple of questions.

What are the criteria that determine 'TRIGGERED JOBS' vs 'REQ JOBS'?

Quote:
The 'PROSE' section under each job could be ignored
Did not really get what you meant by this, could you explain further? Looks like all the job names that you need in the output are technically below the 'PROSE section'.


1. The input file will have details of a job spanning several lines with sections - AGENT INFORMATION, PROSE , TRIGGERED JOBS and REQUIREMENTS AND NETWORK CONNECTIONS.

2. I dont want details under PROSE, but want certain details for the job from all other sections. For eg for the first job FOFAC001, it doesn't have 'REQUIREMENTS AND NETWORK CONNECTIONS' section, so in output file, for FOFAC001 it has blanks under 'REQ JOBS'. But the second job FOFAC002 has this section.

3. In the input file, the headers for each sections (AGENT INFORMATION, PROSE , TRIGGERED JOBS and REQUIREMENTS AND NETWORK CONNECTIONS) begin at the same positions for all the jobs i.e.:
a) 'AGENT INFORMATION' header begins at 35.
b) 'PROSE' header begins at 42.
c) 'TRIGGERED JOBS' header begins at 37.
d) 'REQUIREMENTS AND NETWORK CONNECTIONS' header begins at 25
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 DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 0 Tue Nov 13, 2018 7:55 pm
No new posts Can records in IMS/DB be related usin... SRICOBSAS IMS DB/DC 2 Fri Oct 19, 2018 3:53 pm
No new posts Need help on the multiple files refor... wik123 DFSORT/ICETOOL 7 Wed Sep 19, 2018 10:47 am
No new posts Delete Multiple rows in chunks by usi... dharmaraok DB2 5 Tue Sep 11, 2018 8:44 pm
No new posts Concatenaing multiple rows to single ... Vignesh Sid DFSORT/ICETOOL 1 Tue Aug 14, 2018 8:59 am

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