I have DATE filed like DD-MM-YYYY, So I want output should be
MM/DD/YYYY using JCL?

Can anybody post the answer for above requirement?

Answers were Sorted based on User's Feedback



I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / harsha

12345678910
DD-MM-YYYY
Above is the date and column numbers.

//STEP1 EXEC PGM=SORT
// .
// .
// .
OPTION COPY
OUTFILE FNAMES=SORTOUT
OUTREC=(4,2,C'/',1,2,C'/',7,4)

Is This Answer Correct ?    14 Yes 1 No

I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / mfgan

When DD-MM-YYYY is the first field of input record,
Then use the below code,

//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,2,
3:C'/',
4:4,2,
6:C'/',
7:7,4)
/*
//
When others,
Change the position numbers occordingly.

Is This Answer Correct ?    2 Yes 0 No

I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / pranay

OUTREC FIELDS=(4,2,C'/',1,2,C'/',7,4)

The above Sort card is working perfectly fine for me.
Please recheck.

Is This Answer Correct ?    2 Yes 0 No

I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / raghuvanshi

When I am using
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(4,2,C'/',1,2,C'/',7,4)
/*
//

I am getting the same output as input!
Can someone please through some light on it.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More JCL Interview Questions

Why we will create load module in PDS only, Why nt in PS?

2 Answers   TCS,


What is dummy parameter in JCL??

3 Answers   TCS,


How do You skip a Step In JCL?

9 Answers   HTC,


How to send data from cobol program to jcl?

2 Answers   CSC,


I have a sequential file in which there are 50 records. Now I want to copy all the 50 records in the reverse order into a new file? The last record in the original file should be the first record in the new file. How can I do it?

4 Answers   IBM, TCS,






what operation is performed by job statement?

0 Answers   IBM,


How is a type of file defined in the jcl that executes the cobol program?

0 Answers  


Could anyone please suggest me what is the maximum length of data that can be pass as input in //sysin dd * This was asked in interview. TIA

3 Answers   VC, Wipro,


What is DATACOM db?

2 Answers  


I HAVE A VB BLOCK WHICH IS USED AS INPUT IN COBOL CONATINING SOME RECORDS CAN I CHANGE THE FILE FROM VB TO FB?

0 Answers  


what is d/f b/w sysout & sysprint

4 Answers   TCS,


How does jcl specify the job to the operating system?

0 Answers  


Categories