Clicky
Skip to Content
Custom Search

JCL

JCL Forum is for asking your JCL related queries.

Extract a few members from a PDS

Hi All,

I would like to get a few members from a PDS.

I can always get all the members using the below

//SYSTSIN DD *
LISTDS 'your pds name' MEMBERS
/*

and get the required members using sort in the next step. But, is there a way to get it done using the above syntax itself?

There is something called LEVEL keyword allowed in the LISTDS option. How do I use it?

Thanks

Run SSIS Packages from Micro Focus Enterprise Server JCL

Run SSIS Packages from Micro Focus Enterprise Server JCL
Hi All,
Is it possible to run SSIS packages from Micro Focus Enterprise JCL, It will be of great help if someone can provide examples for this

OMIT the records if space occurs in any place of a Five length filed....

Hi All...

My requirement is...

I have field with Length 5 (Alpha Numeric)

This field contains the below values

" " (All 5 Spaces)
"AB " (3 Spaces)
"ABC " (2 Spaces)

If a Space occurs in any place, I want to pull/omit those records...

This i have achieved by using the below Sort card..

OMIT COND = (30,5,CH,EQ,C' '),OR,(32,3,CH,EQ,C' '),OR,
(33,2,CH,EQ,C' '))

But i am looking better way of achieving, instead of coding multiple OR conditions...

Any help can pls throw some ligths!!!

Thanks in Advance,
Veera.

Year as last qualifier of dataset in a job

I struggled a lot to figure out the approach to put year in last qualifier of datasets produced by a job. I had a requirement where the job should create the ouput files with year as the last qualifier.
for eg.
If the output file was ABC.OUTPUT
then the job should produce ABC.OUTPUT.A2013
After some research I have figured out the solution and it is two parts.
 
First you will need to run the following JCL to put the current year in a parm MEMOUT, this step uses SORT utility to overlay the contents in input member MEMINP with year value of DATE1.
Contents of MEMIN
//SET1 SET YEAR=
 
 
//************************************************************         
//*JCL TO PUT CURRENT YEAR IN MEMBER PARM USING SORT *********         
//************************************************************         
//STEP1    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=USERID..INPUT.PDS(MEMINP),DISP=SHR                    
/*                                                                     
//SORTOUT  DD DSN=USERID..INPUT.PDS(MEMOUT),DISP=OLD                    
//SYSIN    DD  *                                                       
  SORT FIELDS=COPY                                                     
  OUTREC OVERLAY=(1:1,16,DATE1,21:30X)                                 
/*                                                                     
 
After the above job has run the contents of MEMOUT will have the following
//SET1 SET YEAR=2013
Now the following job can be run by including MEMOUT and this will append year value set in MEMOUT to the output dataset
 
//JOBCARD
//       JCLLIB ORDER=USERID..INPUT.PDS                                
//       INCLUDE MEMBER=MEMOUT                                         
//************************************************************         
//*JCL TO APPEND YR AS QUALIFIER IN A FLAT FILE    ***********         
//*YOU NEED TO RUN SRTYEAR JCL PRIOR TO THIS JCL   ***********         
//************************************************************         
//STEP1  EXEC PGM=IEFBR14                                              
//DD01   DD DSN=USERID..PSFILE.A&YEAR,                                  
//           SPACE=(TRK,(1,1),RLSE),                                   
//       DISP=(MOD,DELETE,DELETE),UNIT=SYSDA                           
//STEP2    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                        
 TEST FILE FIRST                                                       
/*                                                                     
//SORTOUT  DD DSN=USERID..PSFILE.A&YEAR,                                
//           SPACE=(TRK,(1,1),RLSE),                                   
//            DISP=(MOD,KEEP,KEEP),UNIT=SYSDA,                         
//            DCB=(LRECL=80,RECFM=FB)                                  
//SYSIN    DD  *                                                      
  SORT FIELDS=COPY                                                     
/*                                                                     
                                        
 
 

 

Sort

Hi,

Need Code for the below input and output:

Infile:

01/12/2013 54789829
01/12/2013 12345679
01/12/2013 87653672
14/12/2013 10248964
14/12/2013 00145687

Outfile:

01/12/2013 3
14/12/2013 2

How to get this output?

Mainframes Sorting from PS file

I have a PS file with the data as '002205201300000000' i need to take the date only that is '22052013' and compare it with the system date using JCL .

Please help

Need Help on OUTREC in JCL

Hi,

I have INPUT File as Below:

MSP00855435901
MSP9825359300

I need to Skip one 0(Zero) before MSP only if u have 1 in the 14th position.

Thanks,
Baba,
luckeyjan10@gmail.com

Full form of SOC7

What is the full form of SOC7?

Nested Proc

Can anybody explain nested procedures with examples?

FTP failure

Is there any JCL to check for FTP job failure as FTP job runs with MAXCC=0 even if the file is transferred successfully or not.

decommisioning a job

i am sending files to server using a jcl code..
now i ve ro stop sending the jobs to the server..
pls anyone help how to decommission the job???

JCL Realtime questions

please send me some Realtime questions.

CREATION OF VSAM FILE

HOW TO CREATE A VSAM FILE, THAT MUST BE READ/WRITE BY THE MULTI USERS AT A TIME, MAY I KNOW WHAT ARE THE IDCAM UTILITIES HAVE TO BE USED. TO CREATE SUCH KIND OF A VSAM

Split a file using delimiter in jcl

need split the below file using ;

select *
from emp
where sal>1000
;
select *
from emp
where sal<200
and mang='ravi'
;
.
.
.
.
.

I want to split each query in separate files. please help me

test jcl for errors

There was a job you could run that would thoroughly test jcl without running and it wasnt typrun=scan - what is it?

regarding taking backup of a file

i have a gdg input file i'm trying to take back up of the file by using F33 cmd in that managemant class is specified as work1 so i replaced it with tps370 which is used as a managemant clses for taking the backup.
in this case im getting an error.could you please guide me

Writing 2 output from one Sort

I would like to write an output file containing a certain sort criteria and would like the remaining records that do not fit the criteria to be written to another dataset. How should that be written?

SYSTEM COMPLETION CODE=0C1 REASON CODE=00000001

I am getting the following S0C1 abend while running a simple program. Can some one help me figure out the exact issue.

 

The job log is shown as below

 

 

SYSTEM COMPLETION CODE=0C1  REASON CODE=00000001

 TIME=10.10.18  SEQ=45770  CPU=0000  ASID=0176

 PSW AT TIME OF ERROR  078D0000   80000002  ILC 2  INTC 01

   NO ACTIVE MODULE FOUND

   NAME=UNKNOWN

 

 

I am not sure why I am getting "NO ACTIVE MODULE FOUND" message.

Need FTP delete card to delete the files from shared folder

Hi All,

Please help me to work on below requirements.

 

  • Create  FTP control cards to delete the 30 days older  files
  • FTP steps to delete the older files

These files need to delete from shared folder. please help me..

"; ; ; ;

PC to Mainframe

hi, 

how to upload a file having data into mainframe by using JCL. 

Please provide me with deep explanation. Thank you. 

Regards, 
Venkatesh.

 

 

"; ; ; ;

JCL SORT

Please give me the solution in JCL SORT for the required output !!

The input file has the following records

Peter

Peter

Peter

Ram

Ram

Josh

Josh

Josh

My required output file should be 

Peter

Ram

Josh

Peter

Ram

Josh

Peter

Josh

spool backup jobs

Looking for JCL/REXX code to take spool backup into PS/PDS(member) on a Daily Basis 

"; ; ; ;

Unload all the members of PDS(VB) to PS file

Unload all the members of PDS(VB) to PS file

Problem with SORT OUTRFIL and OUTREC

Hi,

Am facing one problem for below scenario.

//STEP01   EXEC PGM=SYNCSORT                                      
//SYSPRINT DD SYSOUT=*                                            
//SYSOUT   DD SYSOUT=*                                            
//SYSDUMP  DD SYSOUT=*                                            
//SORTIN   DD DSN=MLIFE24.VCSE.MIS.MISEXTRM(+0),DISP=SHR          ---> lrecl size is 20476 and recfm is VB
//PVALOUT  DD DSN=TLIFE24.VCSED.MIS.PVAL2,                        
//            DISP=(NEW,CATLG,DELETE),                            
//            DATACLAS=DATAF,LRECL=3000                           
//INQCOUT  DD DSN=TLIFE24.VCSED.MIS.INQC2,                        
//            DISP=(NEW,CATLG,DELETE),                            
//            DATACLAS=DATAF,LRECL=3000                           
//SYSIN    DD *                                                   
 SORT FIELDS=COPY           
 OUTFIL FNAMES=PVALOUT,INCLUDE=(67,4,CH,EQ,C'PVAL')               
 OUTFIL FNAMES=INQCOUT,INCLUDE=(67,4,CH,EQ,C'INQC')               
     OUTREC FIELDS=(1:19,3,4:39,15,19:59,8,27:67,4,31:92,2963),VTOF
/*                                                                 

I need output dataset size only 3000.

Am getting below error.

WER146B  4K BYTES OF EMERGENCY SPACE ALLOCATED              
WER108I  SORTIN   : RECFM=VB   ; LRECL= 20476; BLKSIZE= 27998
WER237I  OUTREC RECORD LENGTH =  2993                       
WER110I  PVALOUT  : RECFM=FB   ; LRECL=  3000; BLKSIZE= 27000
WER110I  INQCOUT  : RECFM=FB   ; LRECL=  3000; BLKSIZE= 27000
WER247A  PVALOUT  HAS INCOMPATIBLE LRECL                    
WER247A  INQCOUT  HAS INCOMPATIBLE LRECL                     

Please someone help me. 

Problem with SORT OUTRFIL and OUTREC

Hi,

Am facing one problem for below scenario.

//STEP01   EXEC PGM=SYNCSORT                                      
//SYSPRINT DD SYSOUT=*                                            
//SYSOUT   DD SYSOUT=*                                            
//SYSDUMP  DD SYSOUT=*                                            
//SORTIN   DD DSN=MLIFE24.VCSE.MIS.MISEXTRM(+0),DISP=SHR          ---> lrecl size is 20476 and recfm is VB
//PVALOUT  DD DSN=TLIFE24.VCSED.MIS.PVAL2,                        
//            DISP=(NEW,CATLG,DELETE),                            
//            DATACLAS=DATAF,LRECL=3000                           
//INQCOUT  DD DSN=TLIFE24.VCSED.MIS.INQC2,                        
//            DISP=(NEW,CATLG,DELETE),                            
//            DATACLAS=DATAF,LRECL=3000                           
//SYSIN    DD *                                                   
 SORT FIELDS=COPY           
 OUTFIL FNAMES=PVALOUT,INCLUDE=(67,4,CH,EQ,C'PVAL')               
 OUTFIL FNAMES=INQCOUT,INCLUDE=(67,4,CH,EQ,C'INQC')               
     OUTREC FIELDS=(1:19,3,4:39,15,19:59,8,27:67,4,31:92,2963),VTOF
/*                                                                 

I need output dataset size only 3000.

Am getting below error.

WER146B  4K BYTES OF EMERGENCY SPACE ALLOCATED              
WER108I  SORTIN   : RECFM=VB   ; LRECL= 20476; BLKSIZE= 27998
WER237I  OUTREC RECORD LENGTH =  2993                       
WER110I  PVALOUT  : RECFM=FB   ; LRECL=  3000; BLKSIZE= 27000
WER110I  INQCOUT  : RECFM=FB   ; LRECL=  3000; BLKSIZE= 27000
WER247A  PVALOUT  HAS INCOMPATIBLE LRECL                    
WER247A  INQCOUT  HAS INCOMPATIBLE LRECL                     

Please someone help me.

To update card dynamically

"; ; ; ;

Hi,
Following is my current flow:
1. A map is send to user.
2. The user enters the details: a. DSN name, b. Option to select the name of client. c. Option to perform activity on DSN name.
3. An program is invoked to check if all the data enters is correct or not.
4. If all if fine, an JCL is submitted to create the Trailer record for the corresponding file.
5. When the program step runs fine and SMTPBTCH proc is invoked to update the user. An email attachment is also sent. the attachment has the records and the trailer record.

My query:
Once the PROGRAM step runs fine, an email needs to be sent. The email content should also have the file name. There are 16 clients and user may provide any DSN name. Is there any facility where I can update my JOB card where an DSN name is updated everytime.

following may be the content of card:
THE INPUT FILE PROVIDED IS PROCESSED SUCCESFFULY.

KINDLY CHECK YOUR INPUT FILE FOR THE UPDATED Trailer RECORD DETAILS.

DSN Name: (************************************). This Space is entered once the Program step runs fine?

Regards,
Krunal bafna

 

No Delete step in JCL contains UCC 11

There is a strange problem I noticed in a JCL that is running in production. There are few datasets that are created in the job but there is no delete step coded in the JCL.
When the Job is rerun it does not give any error indicating that the dataset already exists for those that are cataloged in the jcl.
I really do not understand this. But I notice that there is some UCC step at the start of the job.

Conversion from Character to Binary

Please help on the below requirement:

I have an input file of LRECL=300.it is having some 'n' records. Split the file into 10 fields each field of length 30 bytes.Get the binary counts of 10 fields. Finally add  all the binary counts. 

 

 

 

List all datasets starting with Qualifier

Can someone provide a batch job to create the list of datasets with a high level qualifier?

send email using SMTPNOTE in mainframe

Use the following JCL to send email from mainframe using SMTPNOTE. There are other ways of sending emails as well.

Note:- Attachements can't be send using SMTPNOTE.

 

//STEP01   EXEC PGM=IKJEFT01,
//             DYNAMNBR=250
//SYSPROC  DD  DSN=XXX.DSN.ALLOC.TO.SYSPROC,
//             DISP=SHR
//SYSTSIN  DD  *
SMTPNOTE +
   TO()        +
   CC()        +
   SU(SUBJECT HERE)                      +
   DA('USERID.DSN.BODY.TEXT')  BATCH
//SYSTSPRT DD  SYSOUT=*
//SYSUDUMP DD  SYSOUT=*

  • 1
  • 2
  • 3
  • next ›
  • last »
Syndicate content

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Who's online

There are currently 0 users and 47 guests online.
Dr. Radut